I\'ve got a map that stores a simple struct with a key. The struct has two member functions, one is const the other not. I\'ve managed calling the const function using std::
If you are already depend on Boost
, you may be willing to check Boost Foreach
BOOST_FOREACH(MyMap::value_type const& val, MyMap)
{
val.second.someConstFunction();
}
Much much readable, though I don't know about performance issues.
Also note that you can't use templated typed within the macro without "escaping" the ,
character: