Answer the question
In order to leave comments, you need to log in
Why can't I access the unordered_map element by traversal?
I have a class in which one public field is unordered_map from objects of another class, which also has a public field unordered_map already from objects of the third class. I want to iterate over all elements of unordered_map by calling a function from the first class. I made this bypass:
unordered_map<string, interfaceBlock>::const_iterator it, it2;
it = interfaceBlockHash.begin();
while (it != interfaceBlockHash.end())
{
unordered_map<string, button>::const_iterator it_button;
it_button = it->second.buttonHash.begin();
while (it_button != it->second.buttonHash.end())
{
it_button->second.hoverReact(m, w); //проблема
it_button++;
}
it++;
}
a.interfaceBlockHash["first"].buttonHash["second"].hoverReact(m, window);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question