]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/smart_ptr/test/make_unique_array_throws_test.cpp
2 Copyright 2014 Glen Joseph Fernandes
5 Distributed under the Boost Software License, Version 1.0.
6 (http://www.boost.org/LICENSE_1_0.txt)
8 #include <boost/config.hpp>
9 #if !defined(BOOST_NO_CXX11_SMART_PTR)
10 #include <boost/detail/lightweight_test.hpp>
11 #include <boost/smart_ptr/make_unique.hpp>
15 static unsigned instances
;
30 type
& operator=(const type
&);
33 unsigned type::instances
= 0;
37 BOOST_TEST(type::instances
== 0);
39 boost::make_unique
<type
[]>(6);
40 BOOST_ERROR("make_unique did not throw");
42 BOOST_TEST(type::instances
== 0);
44 BOOST_TEST(type::instances
== 0);
46 boost::make_unique
<type
[][2]>(3);
47 BOOST_ERROR("make_unique did not throw");
49 BOOST_TEST(type::instances
== 0);
51 BOOST_TEST(type::instances
== 0);
53 boost::make_unique_noinit
<type
[]>(6);
54 BOOST_ERROR("make_unique_noinit did not throw");
56 BOOST_TEST(type::instances
== 0);
58 BOOST_TEST(type::instances
== 0);
60 boost::make_unique_noinit
<type
[][2]>(3);
61 BOOST_ERROR("make_unique_noinit did not throw");
63 BOOST_TEST(type::instances
== 0);
65 return boost::report_errors();