]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/phoenix/test/bll_compatibility/rvalue_test.cpp
1 // rvalue_test - test lambda function objects with rvalue arguments
3 // Copyright (c) 2007 Peter Dimov
5 // Distributed under the Boost Software License, Version 1.0.
6 // See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt
9 #include <boost/lambda/lambda.hpp>
10 #include <boost/detail/lightweight_test.hpp>
14 using namespace boost::lambda
;
20 BOOST_TEST( _1( x
) == 0 );
21 BOOST_TEST( _1( y
) == 1 );
22 BOOST_TEST( _1( 2 ) == 2 );
24 BOOST_TEST( _2( x
, x
) == 0 );
25 BOOST_TEST( _2( x
, y
) == 1 );
26 BOOST_TEST( _2( x
, 2 ) == 2 );
28 BOOST_TEST( _2( 4, x
) == 0 );
29 BOOST_TEST( _2( 4, y
) == 1 );
30 BOOST_TEST( _2( 4, 2 ) == 2 );
44 BOOST_TEST( _3( x
, x
, x
) == x
);
45 BOOST_TEST( _3( x
, x
, y
) == y
);
46 BOOST_TEST( _3( x
, x
, 2 ) == 2 );
48 BOOST_TEST( _3( x
, 5, x
) == x
);
49 BOOST_TEST( _3( x
, 5, y
) == y
);
50 BOOST_TEST( _3( x
, 5, 2 ) == 2 );
52 BOOST_TEST( _3( 9, 5, x
) == x
);
53 BOOST_TEST( _3( 9, 5, y
) == y
);
54 BOOST_TEST( _3( 9, 5, 2 ) == 2 );
56 return boost::report_errors();