]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/bind/bind_visitor.cpp
1 #include <boost/config.hpp>
3 #if defined(BOOST_MSVC)
4 #pragma warning(disable: 4786) // identifier truncated in debug info
5 #pragma warning(disable: 4710) // function not inlined
6 #pragma warning(disable: 4711) // function selected for automatic inline expansion
7 #pragma warning(disable: 4514) // unreferenced inline removed
11 // bind_visitor.cpp - tests bind.hpp with a visitor
13 // Copyright (c) 2001 Peter Dimov and Multi Media Ltd.
15 // Distributed under the Boost Software License, Version 1.0. (See
16 // accompanying file LICENSE_1_0.txt or copy at
17 // http://www.boost.org/LICENSE_1_0.txt)
20 #include <boost/bind/bind.hpp>
21 #include <boost/ref.hpp>
25 using namespace boost::placeholders
;
31 template<class T
> void operator()( boost::reference_wrapper
<T
> const & r
) const
33 std::cout
<< "Reference to " << typeid(T
).name() << " @ " << &r
.get() << " (with value " << r
.get() << ")\n";
36 template<class T
> void operator()( T
const & t
) const
38 std::cout
<< "Value of type " << typeid(T
).name() << " (with value " << t
<< ")\n";
42 int f(int & i
, int & j
, int)
54 using namespace boost
;
57 visit_each(v
, bind
<int>(bind(f
, ref(x
), _1
, 42), ref(y
)), 0);