Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2005-10-27 08:28:41


<Oliver.Kowalke_at_[hidden]> writes:

> Hi,
> how is it possible to inherit from all items inside mpl::vector?
>
> template< typename V >
> class multi
> : .... // ?????
> {};
>
> typedef multi < mpl::vector< A ,B, C > > multi _t;
> multi_t m; // m has all public and protected member functions of A, B
> and C

  struct empty {};

  typedef mpl::fold<
      V, empty, mpl::inherit<_,_>
>::type multi_t;

HTH,

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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