|
Boost : |
From: Rick Sloan (richard.sloan1_at_[hidden])
Date: 2005-05-01 13:24:39
Hello all,
Given a mpl::list
typedef mpl::list<structA, structB, structC> typeList;
and a wrapper struct
template <class T>
struct wrap
{
virtual void someFunction(T&) = 0;
virtual ~wrap
}
You can generate a class by
mpl::inherit_linearly<typeList, mpl::inherit<wrap<_2>,_1> >:;type generated;
This is pretty much straight from "C++ Template Metaprogramming" pg. 193-194.
My question is how do you generate the derived concrete class? I can
override any particular function by
struct Child : public generated
{
virtual void someFunction(structA&);
}
but I can't seem to generate an entire class. I apologize if this is a
newbie question, but alas I am a newbie to template metaprogramming.
Regards,
Rick Sloan
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk