Ok here is the code snippet that I am having the problem with (class name has been changed due to work reason)
const std::map<A*, std::pair<int, B*> > &aMap = ot->getAMap();
A *a = getAFromSomewhere();
B* b = aMap[a].second; //The line that the compilation error points to.
Error: The operation "
const std::map<A*, std::pair<int, B*>, std::less<A*>, std::allocator<std::pair<A*const, std::pair<int, B*>>>>[A*]" is illegal.
anyone has any idea why this is so?
B*is not valid C++.