I use mpl::vector
from boost 1.58. I have types:
typedef mpl::vector <base1, base2, base3> types;
If I have a class derived, how can i inherit it from all of these types in this mpl::vector
?
I use mpl::vector
from boost 1.58. I have types:
typedef mpl::vector <base1, base2, base3> types;
If I have a class derived, how can i inherit it from all of these types in this mpl::vector
?
You may use inherit_linearly.
Example of usage:
class A
{
public:
void a() {}
};
class B
{
public:
void b() {}
};
class C
{
public:
void c() {}
};
typedef boost::mpl::vector<A, B, C> types;
class Derived :
public boost::mpl::inherit_linearly<types,
boost::mpl::inherit<boost::mpl::_1, boost::mpl::_2> >::type
{
};
int main()
{
Derived d;
d.a();
d.b();
d.c();
}