Boost logo

Boost Users :

Subject: [Boost-users] boost::mpl::max_element and boost::mpl::vector
From: peter_foelsche_at_[hidden]
Date: 2008-09-30 14:52:42


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<typename CDB, typename CDB1>
        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<CDB, CDB1>::value));

But this does not compile.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net