перебор мапы по значению
От: IROV..  
Дата: 21.10.05 14:27
Оценка:
    template<class T_Function >
    class FMapSecondBinder
        : public T_Function
    {
    public:
        template<class T_Pair>
            void operator()( const T_Pair &Value )const
        {
            T_Function::operator()(Value.second);
        }
    };

    template<class T_Function >
        const FMapSecondBinder<T_Function> & second_binder(const T_Function &Function)
    {
        return *(const FMapSecondBinder<T_Function>*)(&Function);
    }



Насколько опастны эти трюки

Юзать так..


std::for_each(Map.begin(),Map.end(),second_binder(MyFunctor()));
я не волшебник, я только учусь!
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.