]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/function/test/mem_fun_cxx98.cpp
3 // Copyright (C) 2001-2003 Douglas Gregor
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)
9 // For more information, see http://www.boost.org/
12 #include <boost/function.hpp>
13 #include <boost/detail/lightweight_test.hpp>
18 Y(int y
= 0) : y_(y
) {}
19 bool operator==(const Y
& rhs
) { return y_
== rhs
.y_
; }
28 int X::foo(int x
) { return -x
; }
29 Y
& X::foo2(Y
& x
) const { return x
; }
33 boost::function
<int (X
*, int)> f
;
34 boost::function
<Y
& (X
*, Y
&)> f2
;
41 BOOST_TEST(f(&x
, 5) == -5);
42 BOOST_TEST(f2(&x
, boost::ref(y1
)) == y1
);
44 return ::boost::report_errors();