Boost logo

Boost Users :

From: Rick Sloan (richard.sloan1_at_[hidden])
Date: 2005-05-02 09:09:00

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.

Rick Sloan

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at