]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/bind/test/std_placeholders_test.cpp
1 // Copyright 2021 Peter Dimov
2 // Distributed under the Boost Software License, Version 1.0.
3 // https://www.boost.org/LICENSE_1_0.txt
5 #include <boost/bind/bind.hpp>
6 #include <boost/core/lightweight_test.hpp>
8 #include <boost/config.hpp>
9 #include <boost/config/pragma_message.hpp>
11 #if defined(BOOST_NO_CXX11_HDR_FUNCTIONAL)
13 BOOST_PRAGMA_MESSAGE( "Skipping test due to BOOST_NO_CXX11_HDR_FUNCTIONAL being defined" )
16 #elif defined(BOOST_NO_CXX11_DECLTYPE)
18 BOOST_PRAGMA_MESSAGE( "Skipping test due to BOOST_NO_CXX11_DECLTYPE being defined" )
21 #elif defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)
23 BOOST_PRAGMA_MESSAGE( "Skipping test due to BOOST_NO_CXX11_HDR_TYPE_TRAITS being defined" )
35 using namespace std::placeholders
;
37 BOOST_TEST_EQ( boost::bind( f
, _1
)( 1 ), -1 );
38 BOOST_TEST_EQ( boost::bind( f
, _2
)( 1, 2 ), -2 );
39 BOOST_TEST_EQ( boost::bind( f
, _3
)( 1, 2, 3 ), -3 );
40 BOOST_TEST_EQ( boost::bind( f
, _4
)( 1, 2, 3, 4 ), -4 );
41 BOOST_TEST_EQ( boost::bind( f
, _5
)( 1, 2, 3, 4, 5 ), -5 );
42 BOOST_TEST_EQ( boost::bind( f
, _6
)( 1, 2, 3, 4, 5, 6 ), -6 );
43 BOOST_TEST_EQ( boost::bind( f
, _7
)( 1, 2, 3, 4, 5, 6, 7 ), -7 );
44 BOOST_TEST_EQ( boost::bind( f
, _8
)( 1, 2, 3, 4, 5, 6, 7, 8 ), -8 );
45 BOOST_TEST_EQ( boost::bind( f
, _9
)( 1, 2, 3, 4, 5, 6, 7, 8, 9 ), -9 );
47 return boost::report_errors();