map operator [] operands
- by Jamie Cook
Hi all I have the following in a member function
int tt = 6;
vector<set<int>>& temp = m_egressCandidatesByDestAndOtMode[tt];
set<int>& egressCandidateStops = temp.at(dest);
and the following declaration of a member variable
map<int, vector<set<int>>> m_egressCandidatesByDestAndOtMode;
However I get an error when compiling (Intel Compiler 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> ^
I know it's got to be something silly but I can't see what I've done wrong.