]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_placeholder_test.cpp
1 /*==============================================================================
2 Copyright (c) 2005 Peter Dimov
3 Copyright (c) 2005-2010 Joel de Guzman
4 Copyright (c) 2010 Thomas Heller
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 ==============================================================================*/
10 #include <boost/config.hpp>
12 #if defined( BOOST_MSVC )
14 #pragma warning(disable: 4786) // identifier truncated in debug info
15 #pragma warning(disable: 4710) // function not inlined
16 #pragma warning(disable: 4711) // function selected for automatic inline expansion
17 #pragma warning(disable: 4514) // unreferenced inline removed
21 #include <boost/phoenix/core.hpp>
22 #include <boost/phoenix/bind.hpp>
24 #if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
25 #pragma warning(push, 3)
30 #if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
34 #include <boost/detail/lightweight_test.hpp>
38 long f( long a
, long b
, long c
, long d
, long e
, long f
, long g
, long h
, long i
)
40 return a
+ 10 * b
+ 100 * c
+ 1000 * d
+ 10000 * e
+ 100000 * f
+ 1000000 * g
+ 10000000 * h
+ 100000000 * i
;
43 template< int I
> struct custom_placeholder
51 template< int I
> struct is_placeholder
< custom_placeholder
< I
> >
53 enum { value
= I
+ 1};
60 using boost::phoenix::bind
;
72 custom_placeholder
<0> p1
;
73 custom_placeholder
<1> p2
;
74 custom_placeholder
<2> p3
;
75 custom_placeholder
<3> p4
;
76 custom_placeholder
<4> p5
;
77 custom_placeholder
<5> p6
;
78 custom_placeholder
<6> p7
;
79 custom_placeholder
<7> p8
;
80 custom_placeholder
<8> p9
;
83 bind( f
, p1
, p2
, p3
, p4
, p5
, p6
, p7
, p8
, p9
)
84 ( x1
, x2
, x3
, x4
, x5
, x6
, x7
, x8
, x9
) == 987654321L );
86 return boost::report_errors();