]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/move/test/unique_ptr_test_utils_end.hpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / libs / move / test / unique_ptr_test_utils_end.hpp
1 //////////////////////////////////////////////////////////////////////////////
2 //
3 // (C) Copyright Howard Hinnant 2009
4 // (C) Copyright Ion Gaztanaga 2014-2014.
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 // See http://www.boost.org/libs/move for documentation.
11 //
12 //////////////////////////////////////////////////////////////////////////////
13 #ifndef BOOST_MOVE_UNIQUE_PTR_TEST_UTILS_END_HPP
14 #define BOOST_MOVE_UNIQUE_PTR_TEST_UTILS_END_HPP
15
16 #ifndef BOOST_MOVE_UNIQUE_PTR_TEST_UTILS_BEG_HPP
17 #error "unique_ptr_test_utils_beg.hpp MUST be included before this header"
18 #endif
19
20 //Define the incomplete I type and out of line functions
21
22 struct I
23 {
24 static int count;
25 I() {++count;}
26 I(const A&) {++count;}
27 ~I() {--count;}
28 };
29
30 int I::count = 0;
31
32 I* get() {return new I;}
33 I* get_array(std::size_t i) {return new I[i];}
34
35 void check(int i)
36 {
37 BOOST_TEST(I::count == i);
38 }
39
40 template <class T, class D>
41 J<T, D>::~J() {}
42
43 void reset_counters()
44 { A::count = 0; B::count = 0; I::count = 0; }
45
46 #endif //BOOST_MOVE_UNIQUE_PTR_TEST_UTILS_END_HPP