B
baltasarq
Hi !
This is a very specific question, regarding of course standard C++.
Say you have a map: map<int, string> m;, for example.
The main idea/use is that you can look for an int, and get the other
part of the pair.
But you can also run over it with a simple loop, using an interator.
iterator map<int, string>::iterator it = m.begin();
whie( it != end ) {
cout << it->second << endl;
++it;
}
The very specific question is:
Will these elements be printed in order, in STANDARD C++, i.e. in
every possible implementation of C++, or maybe -which is probably more
possible- the internal storing of the elemens in the map is compiler-
specific?
Regards,
Baltasar
This is a very specific question, regarding of course standard C++.
Say you have a map: map<int, string> m;, for example.
The main idea/use is that you can look for an int, and get the other
part of the pair.
But you can also run over it with a simple loop, using an interator.
iterator map<int, string>::iterator it = m.begin();
whie( it != end ) {
cout << it->second << endl;
++it;
}
The very specific question is:
Will these elements be printed in order, in STANDARD C++, i.e. in
every possible implementation of C++, or maybe -which is probably more
possible- the internal storing of the elemens in the map is compiler-
specific?
Regards,
Baltasar