]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/function/test/std_bind_cxx98.cpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / libs / function / test / std_bind_cxx98.cpp
1 // Function library
2
3 // Copyright (C) 2001-2003 Douglas Gregor
4
5 // Use, modification and distribution is subject to the Boost Software
6 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
8
9 // For more information, see http://www.boost.org/
10
11 #if defined(__clang__) && defined(__has_warning)
12 # if __has_warning( "-Wdeprecated-declarations" )
13 # pragma clang diagnostic ignored "-Wdeprecated-declarations"
14 # endif
15 #endif
16
17 #include <boost/function.hpp>
18 #include <iostream>
19 #include <functional>
20
21 struct X {
22 int foo(int);
23 };
24 int X::foo(int x) { return -x; }
25
26 int main()
27 {
28 #ifndef BOOST_NO_CXX98_BINDERS
29 boost::function<int (int)> f;
30 X x;
31 f = std::bind1st(
32 std::mem_fun(&X::foo), &x);
33 f(5); // Call x.foo(5)
34 #endif
35 return 0;
36 }