for (it=G_QUERY_LIST.begin(); it!=G_QUERY_LIST.end(); ++it)
cout<< (*it).ena.x;
for (it=G_QUERY_LIST.begin(); it!=G_QUERY_LIST.end(); ++it)
cout<< (*it).ena.x;
To copy to clipboard, switch view to plain text mode
Priority of * is lower than that of "."
FYI: Note that, generally, ++it is faster for iterators.
HTH
PS: If you do not mind using 3rd party libs: using Boost.Foreach your code could be written
#include <boost/foreach.hpp>
BOOST_FOREACH(const A &item, G_QUERY_LIST)
cout<< item.ena.x;
#include <boost/foreach.hpp>
BOOST_FOREACH(const A &item, G_QUERY_LIST)
cout<< item.ena.x;
To copy to clipboard, switch view to plain text mode
Bookmarks