Q:

iterate through unordered_map using boost_foreach

In my class I've got such soundmap
class SoundSubSystem
{
private:
    boost::unordered_map<string, ISoundEngine*> soundmap;
....
};

But how to iterate through it using BOOST_FOREACH?
SoundSubSystem::~SoundSubSystem()
{
    BOOST_FOREACH(/*?*/ item, soundmap) {
        item.second->drop();
    }
};

What value type should item have?

A:

Try this :-  
typedef boost::unordered_map<string, ISoundEngine*> myhash;

BOOST_FOREACH(myhash::value_type& item, soundmap) {
        item.second->drop();
    }

