$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [Boost-users] [MPL] Filtering a sequence to leave only most-derived types
From: Rutger ter Borg (rutger_at_[hidden])
Date: 2010-02-23 06:36:55
Sebastian Redl wrote:
> How do I represent outer_value and inner_value in this expression? It
> seems I can't simply put mpl::_1 and mpl::_2 there, since that gives me a
> static assertion failure (argument is not available). I think I have to
> put an apply somewhere in there, but I can't figure out where.
>
> Sebastian
Not sure, but I would do something like
typedef mpl::vector< A, B, C > m_vec;
typedef mpl::sort<
m_vec,
boost::is_base_of< mpl::_1, mpl::_2 >
>::type sorted_type;
typedef mpl::unique<
sorted_type,
boost::is_base_of< mpl::_1, mpl::_2 >
>::type unique_type;
(untested, but I have the idea that it is close to what you would like it to
do :-))
Cheers,
Rutger