boost::mpl::inherit from a typelist?

When I use typedef boost::mpl::inherit<boost::mpl::list<udt1, udt2, udt3> >::type derived_class; (at least in MSVC) then it inherits directly from boost::mpl::list, instead of inheriting from the individual members of the list. Is there a way to make it inherit from each type in the list instead? inherit_linearly appears to accept anything modelling the ForwardSequence concept as its template argument, so it seems like inherit should do the same unless I'm just missing something.

AMDG Zachary Turner wrote:
typedef boost::mpl::inherit<boost::mpl::list<udt1, udt2, udt3> >::type derived_class;
(at least in MSVC) then it inherits directly from boost::mpl::list, instead of inheriting from the individual members of the list. Is there a way to make it inherit from each type in the list instead? inherit_linearly appears to accept anything modelling the ForwardSequence concept as its template argument, so it seems like inherit should do the same unless I'm just missing something.
mpl::inherit is a simple metafunction that inherits from all its arguments. mpl::inherit_linearly is a thin wrapper around mpl::fold. In Christ, Steven Watanabe
participants (2)
-
Steven Watanabe
-
Zachary Turner