
9 Oct
2011
9 Oct
'11
10:06 p.m.
i just found http://www.boost.org/doc/libs/1_47_0/doc/html/foreach.html from the docs: For example, we can use BOOST_FOREACH with: - STL containers - arrays - Null-terminated strings (char and wchar_t) - std::pair of iterators This way i can use one simple Expression for lists std::list<int> list_int( /*...*/ ); BOOST_FOREACH( int i, list_int ) { // do something with i } or for vertices in graphs: BOOST_FOREACH(my_graph_traits::vertex_descriptor vi, vertices (g)) { std::cout << vi << std::endl; } even though the original question is still there...