I want to implement this:
// returns whether Seq1 includes each of the elements in Seq2
// using Pred to determine type equality
template // whether T1 from Seq1 == T2 from Seq2
struct includes_if;
My ultimate goal is to be able to determine whether every element in
Seq2 is either in Seq1 or has a base class in Seq1. So the predicate
I'll be passing in is a metafunction class that invokes
std::tr1::is_base_of.
Here's my code, all but one line of which is supposed to be correct:
template // whether T1 from Seq1 == T2 from Seq2
struct includes_if
: boost::is_same<
typename mpl::find_if<
Seq2,
mpl::not_ //!!
> >
>::type,
typename mpl::end<Seq2>::type
{};
The line I don't know how to write is flagged, but the functionality I
want to express is shown.
In case it's relevant, here is the rest of my code:
// metafunction class for TR1-conforming is_base_of
struct is_base_of {
template
struct apply: std::tr1::is_base_of {};
};
// returns whether Seq contains an element satisfying Pred
template
struct contains_if
: mpl::not_<
boost::is_same<
typename mpl::find_if< Seq, mpl::apply >::type,
typename mpl::end<Seq>::type
>
{};
Thanks for all help,
Scott