// Copyright Aleksey Gurtovoy 2001-2004 // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // See http://www.boost.org/libs/mpl for documentation. // $Id$ // $Date$ // $Revision$ #include #include #include #include #include #include #include #include #include #include #include struct my { char a[100]; }; MPL_TEST_CASE() { // !(x == char) && !(x == double) || sizeof(x) > 8 typedef lambda< or_< and_< not_< boost::is_same<_1, char> > , not_< boost::is_float<_1> > > , greater< sizeof_<_1>, mpl::size_t<8> > > >::type f; MPL_ASSERT_NOT(( apply_wrap1 )); MPL_ASSERT_NOT(( apply_wrap1 )); MPL_ASSERT(( apply_wrap1 )); MPL_ASSERT(( apply_wrap1 )); } MPL_TEST_CASE() { // x == y || x == my || sizeof(x) == sizeof(y) typedef lambda< or_< boost::is_same<_1, _2> , boost::is_same<_2, my> , equal_to< sizeof_<_1>, sizeof_<_2> > > >::type f; MPL_ASSERT_NOT(( apply_wrap2 )); MPL_ASSERT_NOT(( apply_wrap2 )); MPL_ASSERT_NOT(( apply_wrap2 )); MPL_ASSERT(( apply_wrap2 )); MPL_ASSERT(( apply_wrap2 )); MPL_ASSERT(( apply_wrap2 )); } MPL_TEST_CASE() { // bind <-> lambda interaction typedef lambda< less<_1,_2> >::type pred; typedef bind2< pred, _1, int_<4> > f; MPL_ASSERT(( apply_wrap1< f,int_<3> > )); }