]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/smart_ptr/test/make_unique_noinit_test.cpp
3de787c25f8de671bef94cbc8957163530da8726
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_noinit
<int>();
37 BOOST_TEST(a1
.get() != 0);
40 BOOST_TEST(type::instances
== 0);
42 std::unique_ptr
<type
> a1
= boost::make_unique_noinit
<type
>();
43 BOOST_TEST(a1
.get() != 0);
44 BOOST_TEST(type::instances
== 1);
46 BOOST_TEST(type::instances
== 0);
49 BOOST_TEST(type::instances
== 0);
51 std::unique_ptr
<const type
> a1
= boost::make_unique_noinit
<const type
>();
52 BOOST_TEST(a1
.get() != 0);
53 BOOST_TEST(type::instances
== 1);
55 BOOST_TEST(type::instances
== 0);
58 return boost::report_errors();