]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/smart_ptr/test/make_unique_test.cpp
a2c6b99d87abede04e240cead9966f42287257a5
2 (c) 2014 Glen Joseph Fernandes
3 <glenjofe -at- gmail.com>
5 Distributed under the Boost Software
7 http://boost.org/LICENSE_1_0.txt
9 #include <boost/config.hpp>
10 #if !defined(BOOST_NO_CXX11_SMART_PTR)
11 #include <boost/detail/lightweight_test.hpp>
12 #include <boost/smart_ptr/make_unique.hpp>
16 static unsigned int instances
;
28 type
& operator=(const type
&);
31 unsigned int type::instances
= 0;
36 std::unique_ptr
<int> a1
= boost::make_unique
<int>();
37 BOOST_TEST(a1
.get() != 0);
42 std::unique_ptr
<const int> a1
= boost::make_unique
<const int>();
43 BOOST_TEST(a1
.get() != 0);
47 BOOST_TEST(type::instances
== 0);
49 std::unique_ptr
<type
> a1
= boost::make_unique
<type
>();
50 BOOST_TEST(a1
.get() != 0);
51 BOOST_TEST(type::instances
== 1);
53 BOOST_TEST(type::instances
== 0);
56 BOOST_TEST(type::instances
== 0);
58 std::unique_ptr
<const type
> a1
= boost::make_unique
<const type
>();
59 BOOST_TEST(a1
.get() != 0);
60 BOOST_TEST(type::instances
== 1);
62 BOOST_TEST(type::instances
== 0);
65 return boost::report_errors();