]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/phoenix/test/boost_bind_compatibility/bind_visit_test.cpp
1 /*==============================================================================
2 Copyright (c) 2006 Douglas Gregor <doug.gregor@gmail.com>
3 Copyright (c) 2006 Peter Dimov
4 Copyright (c) 2005-2010 Joel de Guzman
5 Copyright (c) 2010 Thomas Heller
7 Distributed under the Boost Software License, Version 1.0. (See accompanying
8 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 ==============================================================================*/
11 #include <boost/config.hpp>
13 #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
18 # pragma warning(disable: 4100) // unreferenced formal parameter (it is referenced!)
22 #include <boost/phoenix/core.hpp>
23 #include <boost/phoenix/bind.hpp>
24 #include <boost/visit_each.hpp>
26 #if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
27 # pragma warning(push, 3)
33 #if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
37 #include <boost/detail/lightweight_test.hpp>
47 template<typename T
> void operator()( T
const & t
)
49 std::cout
<< "visitor::operator()( T ): " << typeid( t
).name() << std::endl
;
52 void operator()( int const & t
)
54 std::cout
<< "visitor::operator()( int ): " << t
<< std::endl
;
59 int f( int x
, int y
, int z
)
66 using boost::phoenix::bind
;
67 using boost::phoenix::placeholders::_1
;
71 boost::visit_each( vis
, bind( f
, 3, _1
, 4 ) );
73 BOOST_TEST( vis
.hash
== 34 );
75 return boost::report_errors();