]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/smart_ptr/test/make_unique_value_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>
21 std::unique_ptr
<type
> result
= boost::make_unique
<type
>();
22 BOOST_TEST(result
.get() != 0);
23 BOOST_TEST(result
->x
== 0);
24 BOOST_TEST(result
->y
== 0);
27 std::unique_ptr
<const type
> result
=
28 boost::make_unique
<const type
>();
29 BOOST_TEST(result
.get() != 0);
30 BOOST_TEST(result
->x
== 0);
31 BOOST_TEST(result
->y
== 0);
33 #if !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX)
35 std::unique_ptr
<type
> result
=
36 boost::make_unique
<type
>({ 1, 2 });
37 BOOST_TEST(result
.get() != 0);
38 BOOST_TEST(result
->x
== 1);
39 BOOST_TEST(result
->y
== 2);
42 std::unique_ptr
<const type
> result
=
43 boost::make_unique
<const type
>({ 1, 2 });
44 BOOST_TEST(result
.get() != 0);
45 BOOST_TEST(result
->x
== 1);
46 BOOST_TEST(result
->y
== 2);
49 return boost::report_errors();