]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_eq2_test.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / phoenix / test / boost_bind_compatibility / bind_eq2_test.cpp
1 /*==============================================================================
2 Copyright (c) 2004, 2005, 2009 Peter Dimov
3 Copyright (c) 2005-2010 Joel de Guzman
4 Copyright (c) 2010 Thomas Heller
5
6 Distributed under the Boost Software License, Version 1.0. (See accompanying
7 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 ==============================================================================*/
9
10 #include <boost/config.hpp>
11
12 #if defined(BOOST_MSVC)
13 #pragma warning(disable: 4786) // identifier truncated in debug info
14 #pragma warning(disable: 4710) // function not inlined
15 #pragma warning(disable: 4711) // function selected for automatic inline expansion
16 #pragma warning(disable: 4514) // unreferenced inline removed
17 #endif
18
19 #include <boost/phoenix/core.hpp>
20 #include <boost/phoenix/bind.hpp>
21 #include <boost/function_equal.hpp>
22 #include <boost/detail/lightweight_test.hpp>
23
24 void f( int )
25 {
26 }
27
28 int g( int i )
29 {
30 return i + 5;
31 }
32
33 template< class F > void test_self_equal( F f )
34 {
35 #ifdef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
36 using boost::function_equal;
37 #endif
38
39 BOOST_TEST( function_equal( f, f ) );
40 }
41
42 int main()
43 {
44 using boost::phoenix::bind;
45 using boost::phoenix::placeholders::_1;
46
47 test_self_equal( bind( f, _1 ) );
48 test_self_equal( bind( g, _1 ) );
49 test_self_equal( bind( f, bind( g, _1 ) ) );
50
51 return boost::report_errors();
52 }