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
22struct I
23{
24 static int count;
25 I() {++count;}
26 I(const A&) {++count;}
27 ~I() {--count;}
28};
29
30int I::count = 0;
31
32I* get() {return new I;}
33I* get_array(std::size_t i) {return new I[i];}
34
35void check(int i)
36{
37 BOOST_TEST(I::count == i);
38}
39
40template <class T, class D>
41J<T, D>::~J() {}
42
43void reset_counters()
44{ A::count = 0; B::count = 0; I::count = 0; }
45
46#endif //BOOST_MOVE_UNIQUE_PTR_TEST_UTILS_END_HPP
47

source code of boost/libs/move/test/unique_ptr_test_utils_end.hpp