Boost::range::for_each + functor
First of all I would not use boost::range::for_each . There is already standard algorithm std::for_each in C++.

Secondly I would not use a lambda-expression if the algorithm with the predicate is used more than one time.

And if it is used only one time I would use the range-based for statement. For example

for ( const Person &amp;person : vec )
{
    int age = person.getAge();

    if ( age &lt; AGE_LOW_LEVEL )
    {
        age += 2;
    }
    else if ( age &lt; AGE_HIGH_LEVEL )
    {
        age += 1;   
    }
    else
    {
        age -= 5;   
    }

    result.insert( { person.getName(), age } );
}