
25 Feb
2010
25 Feb
'10
12:39 p.m.
Rutger ter Borg
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;
Thank you, I got to the solution with this. I considered using sort+unique at first, but dismissed it because the predicate does not define a total order, and because is_base_of is not a proper equivalence.. But apparently it works anyway. I just had to reverse the condition (i.e. define a is_derived_from metafunction). Sebastian