Boost logo

Boost Users :

Subject: [Boost-users] Class generation using inherit_linearly
From: Peter Nyssen (peter_at_[hidden])
Date: 2010-05-15 02:14:47


Dear boost users,

I'm clearly missing something w.r.t. mpl_inherit and lamba functions.
Could someone enlighten me as to why the following code fails to compile?
The integer template argument in the lambda expression seems to be the
cause?

//--------------------------

#include <boost/mpl/inherit.hpp>
#include <boost/mpl/inherit_linearly.hpp>
#include <boost/mpl/placeholders.hpp>
#include <boost/mpl/vector.hpp>

using namespace boost;
using namespace boost::mpl::placeholders;

template <int C, class T>
struct Wrap {
    T value;
};

typedef mpl::vector<
    int,
    long
> myMemberTypes;

typedef mpl::inherit_linearly<
        myMemberTypes, mpl::inherit<_1, Wrap<5, _2> >
>::type MyClass;

//--------------------------

Many thanks,
Peter


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