1 // 2 // get_deleter_test3.cpp 3 // 4 // Copyright 2002, 2017 Peter Dimov 5 // 6 // Distributed under the Boost Software License, Version 1.0. (See 7 // accompanying file LICENSE_1_0.txt or copy at 8 // http://www.boost.org/LICENSE_1_0.txt) 9 // 10 11 #include <boost/shared_ptr.hpp> 12 #include <boost/make_shared.hpp> 13 #include <boost/core/lightweight_test.hpp> 14 15 struct deleter 16 { 17 }; 18 19 struct deleter2; 20 21 struct X 22 { 23 }; 24 main()25int main() 26 { 27 { 28 boost::shared_ptr<X[]> p = boost::make_shared<X[]>( 1 ); 29 30 BOOST_TEST(boost::get_deleter<void>(p) == 0); 31 BOOST_TEST(boost::get_deleter<void const>(p) == 0); 32 BOOST_TEST(boost::get_deleter<int>(p) == 0); 33 BOOST_TEST(boost::get_deleter<int const>(p) == 0); 34 BOOST_TEST(boost::get_deleter<X>(p) == 0); 35 BOOST_TEST(boost::get_deleter<X const>(p) == 0); 36 BOOST_TEST(boost::get_deleter<deleter>(p) == 0); 37 BOOST_TEST(boost::get_deleter<deleter const>(p) == 0); 38 BOOST_TEST(boost::get_deleter<deleter2>(p) == 0); 39 BOOST_TEST(boost::get_deleter<deleter2 const>(p) == 0); 40 } 41 42 { 43 boost::shared_ptr<X[1]> p = boost::make_shared<X[1]>(); 44 45 BOOST_TEST(boost::get_deleter<void>(p) == 0); 46 BOOST_TEST(boost::get_deleter<void const>(p) == 0); 47 BOOST_TEST(boost::get_deleter<int>(p) == 0); 48 BOOST_TEST(boost::get_deleter<int const>(p) == 0); 49 BOOST_TEST(boost::get_deleter<X>(p) == 0); 50 BOOST_TEST(boost::get_deleter<X const>(p) == 0); 51 BOOST_TEST(boost::get_deleter<deleter>(p) == 0); 52 BOOST_TEST(boost::get_deleter<deleter const>(p) == 0); 53 BOOST_TEST(boost::get_deleter<deleter2>(p) == 0); 54 BOOST_TEST(boost::get_deleter<deleter2 const>(p) == 0); 55 } 56 57 return boost::report_errors(); 58 } 59 60 struct deleter2 61 { 62 }; 63