Hello
I have a function returning a reference to a map, something like this:
1 2 3 4 5 6 7 8 9
|
const std::map<T1, T2>& get_some_map(void) const
{
...
}
void main(void)
{
const std::map<T1, T2>& some_map = get_some_map();
}
|
Now I want to iterate over this map, so I declare
1 2
|
std::map<T1, T2>::iterator it = some_map.begin();
const std::map<T1, T2>::iterator it_end = some_map.end();
|
but I get an error when I compile. Where am I wrong? Thank you
Last edited on