]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/typeof/test/noncopyable.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / typeof / test / noncopyable.cpp
1 // Copyright (C) 2006 Arkadiy Vertleyb
2 // Use, modification and distribution is subject to the Boost Software
3 // License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
4
5 #include "test.hpp"
6 #include <boost/noncopyable.hpp>
7 #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
8
9 struct x : boost::noncopyable
10 {
11 void foo() {}
12 void bar() const {}
13 };
14
15 BOOST_TYPEOF_REGISTER_TYPE(x)
16
17 x& make_ref()
18 {
19 static x result;
20 return result;
21 }
22
23 const x& make_const_ref()
24 {
25 static x result;
26 return result;
27 }
28
29 void foo()
30 {
31 BOOST_AUTO(& v1, make_ref());
32 v1.foo();
33
34 BOOST_AUTO(const& v2, make_const_ref());
35 v2.bar();
36 }