हाय सब मैं एक सदस्य समारोहनक्शा ऑपरेटर [] ऑपरेंड
int tt = 6;
vector<set<int>>& temp = m_egressCandidatesByDestAndOtMode[tt];
set<int>& egressCandidateStops = temp.at(dest);
में निम्नलिखित और एक सदस्य चर के निम्नलिखित घोषणा
map<int, vector<set<int>>> m_egressCandidatesByDestAndOtMode;
लेकिन जब (इंटेल संकलक संकलन मैं कोई त्रुटि मिलती है 11.0)
1>C:\projects\svn\bdk\Source\ZenithAssignment\src\Iteration\PtBranchAndBoundIterationOriginRunner.cpp(85): error: no operator "[]" matches these operands
1> operand types are: const std::map<int, std::vector<std::set<int, std::less<int>, std::allocator<int>>, std::allocator<std::set<int, std::less<int>, std::allocator<int>>>>, std::less<int>, std::allocator<std::pair<const int, std::vector<std::set<int, std::less<int>, std::allocator<int>>, std::allocator<std::set<int, std::less<int>, std::allocator<int>>>>>>> [ const int ]
1> vector<set<int>>& temp = m_egressCandidatesByDestAndOtMode[tt];
1> ^
मुझे पता है कि यह मूर्खतापूर्ण होना है लेकिन मैं नहीं देख सकता कि मैंने क्या गलत किया है।
अद्यतन मैं एक स्थिरांक सदस्य समारोह जिसके कारण सदस्य चर के प्रकार स्थिरांक है से फोन कर रहा हूँ तो मैंने सोचा था कि निम्नलिखित की तरह कुछ इसे ठीक करना चाहिए:
int dest = 0, tt = 6;
const set<int>& egressCandidateStops = m_egressCandidatesByDestAndOtMode[tt].at(dest);
लेकिन कोई पासा .. अभी भी एक ही त्रुटि है।
Potatoswatter से जवाब सही है। अपनी समस्या से बचने के लिए, आपको ढूंढने की आवश्यकता है। – fulmicoton