]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/smart_ptr/test/make_unique_value_test.cpp
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>
22 std::unique_ptr
<type
> a1
= boost::make_unique
<type
>();
23 BOOST_TEST(a1
.get() != 0);
24 BOOST_TEST(a1
->x
== 0);
25 BOOST_TEST(a1
->y
== 0);
29 std::unique_ptr
<const type
> a1
= boost::make_unique
<const type
>();
30 BOOST_TEST(a1
.get() != 0);
31 BOOST_TEST(a1
->x
== 0);
32 BOOST_TEST(a1
->y
== 0);
35 #if !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX)
37 std::unique_ptr
<type
> a1
= boost::make_unique
<type
>({ 1, 2 });
38 BOOST_TEST(a1
.get() != 0);
39 BOOST_TEST(a1
->x
== 1);
40 BOOST_TEST(a1
->y
== 2);
44 std::unique_ptr
<const type
> a1
= boost::make_unique
<const type
>({ 1, 2 });
45 BOOST_TEST(a1
.get() != 0);
46 BOOST_TEST(a1
->x
== 1);
47 BOOST_TEST(a1
->y
== 2);
51 return boost::report_errors();