]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/utility/base_from_member_ref_test.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / utility / base_from_member_ref_test.cpp
1 //
2 // Test that a base_from_member<T&> can be properly constructed
3 //
4 // Copyright 2014 Agustin Berge
5 //
6 // Distributed under the Boost Software License, Version 1.0.
7 // See accompanying file LICENSE_1_0.txt or copy at
8 // http://www.boost.org/LICENSE_1_0.txt
9 //
10
11 #include <boost/utility/base_from_member.hpp>
12
13 #include <boost/detail/lightweight_test.hpp>
14
15 struct foo : boost::base_from_member<int&>
16 {
17 explicit foo(int& ref) : boost::base_from_member<int&>(ref)
18 {
19 BOOST_TEST(&member == &ref);
20 }
21 };
22
23 int main()
24 {
25 int i = 0;
26 foo f(i);
27
28 return boost::report_errors();
29 }