I've been trying to figure out how to use BOOST_FOREACH and the boost::ptr_map class together, but I can't seem to figure out what type I should use.
1 2 3 4 5
boost::ptr_map<A, B> myMap;
typedef std::pair<A, B> myType;
BOOST_FOREACH(myType& i, myMap) {
// do stuff with i
}
I've also tried using pairs with the template parameters <A, B*> as well as a void pointer and I haven't been able to figure it out; all the types I've tried result in an "unable to convert" to the pair type I'm using. Perhaps I'm missing something here; any insight would be helpful.