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; II25 I() {++count;} II26 I(const A&) {++count;} ~II27 ~I() {--count;} 28 }; 29 30 int I::count = 0; 31 get()32I* get() {return new I;} get_array(int i)33I* get_array(int i) {return new I[i];} 34 check(int i)35void check(int i) 36 { 37 BOOST_TEST(I::count == i); 38 } 39 40 template <class T, class D> ~J()41J<T, D>::~J() {} 42 reset_counters()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