I figured it out myself:
template
struct CTargetEqualOrGreater
{ typedef CTargetEqualOrGreater type;
typedef typename boost::mpl::transform<
CDB,
CDB1,
boost::mpl::not_<
boost::mpl::or_<
boost::mpl::and_<
boost::mpl::not_boost::mpl::_1,
boost::mpl::not_boost::mpl::_2
>,
boost::mpl::_1
>
>
>::type CBoolVector;
typedef typename boost::mpl::max_element<CBoolVector>::type CMaxElement;
typedef typename boost::mpl::deref<CMaxElement>::type CDeRef;
static const bool value = CDeRef::value == false;
};
-----Original Message-----
From: FOELSCHE,PETER (A-SantaClara,ex1)
Sent: Tuesday, September 30, 2008 11:53
To: 'boost-users@lists.boost.org'
Subject: [Boost-users] boost::mpl::max_element and boost::mpl::vector
I have two vectors (CDB and CDB1) containing boolean.
I want to make certain that if a bit in the second vector is set,
it must also be set in the first vector.
template
struct CTargetEqualOrGreater
{ static const bool value = boost::mpl::deref<
boost::mpl::max_element<
boost::mpl::transform<
CDB,
CDB1,
boost::mpl::not_<
boost::mpl::or_<
boost::mpl::and_<
boost::mpl::not_boost::mpl::_1,
boost::mpl::not_boost::mpl::_2
>,
boost::mpl::_1
>
>
>
>
>::type::value == 0;
};
...
BOOST_MPL_ASSERT( (CTargetEqualOrGreater::value));
But this does not compile.