[mpl] Please help with mpl::equal
Please tell me why the following fragment prints 0 - I thought it should print 1: typedef mpl::vector_c<int, 1, 2, 3> v1; typedef mpl::vector<mpl::int_<1>, mpl::int_<2>, mpl::int_<3> > v2; cout << mpl::equal<v1, v2>::value << "\n";
"rincewind" wrote
Please tell me why the following fragment prints 0 - I thought it should print 1:
typedef mpl::vector_c<int, 1, 2, 3> v1; typedef mpl::vector<mpl::int_<1>, mpl::int_<2>, mpl::int_<3> > v2; cout << mpl::equal<v1, v2>::value << "\n";
look in the definition of mpl equal <boost/mpl/equal.hpp> and you should be able to discern the reason: template< typename BOOST_MPL_AUX_NA_PARAM(Sequence1) , typename BOOST_MPL_AUX_NA_PARAM(Sequence2) , typename Predicate = is_same<_,_> > struct equal; Hint : Try changing the predicate to mpl::equal_to regards Andy Little
participants (2)
-
Andy Little
-
rincewind