Boost logo

Boost Users :

From: gast128 (gast128_at_[hidden])
Date: 2004-11-22 10:37:14


Yes you are right, it was a simplification.

We have a STL extension library here (which by the way is a good idea for
boost), which applies <algortihms> to complete containers, like:

template <class MapType, class Func>
Func map_for_all_key(const MapType& rMap, Func func)
{
    return detail::for_each_adapter_impl(rMap.begin(),
                                         rMap.end(),
                                         boost::bind
(&MapType::value_type::first, _1),
                                         func);
}

template <class In, class Adapter, class Func>
Func for_each_adapter_impl(In first, In last, Adapter adapter, Func func)
{
    for (; first != last; ++first)
    {
        func(adapter(*first));
    }

    return func;
}

You can now understand why it broke my code.

Wkr,
me


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net