int main() { typedef mpl::int_<0> _0; typedef mpl::int_<1> _1; typedef mpl::int_<2> _2; BOOST_MPL_ASSERT_IS_SAME(mpl::next<_0>::type, _1); BOOST_MPL_ASSERT_IS_SAME(mpl::next<_1>::type, _2); BOOST_MPL_ASSERT_IS_SAME(mpl::prior<_1>::type, _0); BOOST_MPL_ASSERT_IS_SAME(mpl::prior<_2>::type, _1); return 0; }
int main() { typedef mpl::vector10_c<int,0,1,2,3,4,5,6,7,8,9> numbers; typedef mpl::begin<numbers>::type first; typedef mpl::end<numbers>::type last; typedef mpl::advance_c<first,10>::type iter1; typedef mpl::advance_c<last,-10>::type iter2; BOOST_MPL_ASSERT_IS_SAME(iter1, last); BOOST_MPL_ASSERT_IS_SAME(iter2, first); return 0; }
int main() { typedef mpl::range_c<int,0,0> range0; typedef mpl::range_c<int,0,1> range1; typedef mpl::range_c<int,0,10> range10; BOOST_STATIC_ASSERT(mpl::size<range0>::type::value == 0); BOOST_STATIC_ASSERT(mpl::size<range1>::type::value == 1); BOOST_STATIC_ASSERT(mpl::size<range10>::type::value == 10); BOOST_STATIC_ASSERT(mpl::empty<range0>::type::value); BOOST_STATIC_ASSERT(!mpl::empty<range1>::type::value); BOOST_STATIC_ASSERT(!mpl::empty<range10>::type::value); BOOST_MPL_ASSERT_IS_SAME(mpl::begin<range0>::type, mpl::end<range0>::type); BOOST_MPL_ASSERT_NOT_SAME(mpl::begin<range1>::type, mpl::end<range1>::type); BOOST_MPL_ASSERT_NOT_SAME(mpl::begin<range10>::type, mpl::end<range10>::type); BOOST_STATIC_ASSERT(mpl::front<range1>::type::value == 0); BOOST_STATIC_ASSERT(mpl::back<range1>::type::value == 0); BOOST_STATIC_ASSERT(mpl::front<range10>::type::value == 0); BOOST_STATIC_ASSERT(mpl::back<range10>::type::value == 9); return 0; }
int main() { BOOST_MPL_ASSERT_IS_SAME(long, long); BOOST_MPL_ASSERT_IS_SAME(my, my); BOOST_MPL_ASSERT_NOT_SAME(my, long); BOOST_MPL_ASSERT_NOT_SAME(long, my); return 0; }