HI I have several questions. How do I delete a pointer to a bind type and how do i specify  a return type.

2 examples:

I want to transform this BOOST_FOREACH code into std::for_each using lambda.


typedef std::pair<Foo*, Bar*> FooBar

BOOST_FOREACH(FooBar fb , MapFooBar)
{
    delete fb.second;
}

Foo* f = ... ;

BOOST_FOREACH(FooBar fb, MapFooBar)
{
   if (fb.second == o)
        return fb.first;
}

2.) In this case is using BOOST_FOREACH better?