Boost logo

Boost Users :

Subject: [Boost-users] Comparing two mpl::vector types
From: Rodrigo Madera (rodrigo.madera_at_[hidden])
Date: 2013-02-22 19:32:29


Hello all,

Can anyone give me a hint on how to call a functor on the differences of
two same size mpl::vector types?

For example, given:

typedef boost::mpl::vector<int, char, short, double> v0_type;
typedef boost::mpl::vector<int, int, short, std::string> v1_type;

We can see that the second and third elements don't match, so I wish to
call a functor twice, with the following signature:

struct SomeFunctor {
        template <typename T, typename U>
        void operator()(T t, U u) const {
                // do something nice here
        }
};

In this example, functor would be called twice: once with [T=char, U=int]
and another with [T=short, U=std::string], along with their values.

Thanks for any light,
Rodrigo



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