]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_rv_sp5_test.cpp
1 /*==============================================================================
2 Copyright (c) 2006 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)
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
19 #include <boost/phoenix/core.hpp>
20 #include <boost/phoenix/bind.hpp>
22 #if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
23 #pragma warning(push, 3)
28 #if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
32 #include <boost/detail/lightweight_test.hpp>
33 #include <boost/shared_ptr.hpp>
51 boost::shared_ptr
<X
> f()
53 return boost::shared_ptr
<X
>( new X( 42 ) );
59 using boost::phoenix::bind
;
60 //using boost::phoenix::placeholders::_1;
64 // Change bind_rv_sp_test.cpp to bind to _1. Renamed f to g in y
65 //BOOST_TEST( bind( &X::f, _1) ( bind( &Y::g, &y )()) == 42 );
66 boost::shared_ptr
<X
> xp
= bind( &Y::f
, &y
)();
67 //BOOST_TEST( bind( &X::f, xp)() == 42 );
68 BOOST_TEST( (*xp
).f() == 42 );
69 return boost::report_errors();