]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/smart_ptr/test/make_local_shared_arrays_test.cpp
2 Copyright 2017 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_RVALUE_REFERENCES) && \
10 !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && \
11 !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX)
12 #include <boost/core/lightweight_test.hpp>
13 #include <boost/smart_ptr/make_local_shared.hpp>
18 boost::local_shared_ptr
<int[][2]> result
=
19 boost::make_local_shared
<int[][2]>(2, {0, 1});
20 BOOST_TEST(result
[0][0] == 0);
21 BOOST_TEST(result
[0][1] == 1);
22 BOOST_TEST(result
[1][0] == 0);
23 BOOST_TEST(result
[1][1] == 1);
26 boost::local_shared_ptr
<int[2][2]> result
=
27 boost::make_local_shared
<int[2][2]>({0, 1});
28 BOOST_TEST(result
[0][0] == 0);
29 BOOST_TEST(result
[0][1] == 1);
30 BOOST_TEST(result
[1][0] == 0);
31 BOOST_TEST(result
[1][1] == 1);
34 boost::local_shared_ptr
<const int[][2]> result
=
35 boost::make_local_shared
<const int[][2]>(2, {0, 1});
36 BOOST_TEST(result
[0][0] == 0);
37 BOOST_TEST(result
[0][1] == 1);
38 BOOST_TEST(result
[1][0] == 0);
39 BOOST_TEST(result
[1][1] == 1);
42 boost::local_shared_ptr
<const int[2][2]> result
=
43 boost::make_local_shared
<const int[2][2]>({0, 1});
44 BOOST_TEST(result
[0][0] == 0);
45 BOOST_TEST(result
[0][1] == 1);
46 BOOST_TEST(result
[1][0] == 0);
47 BOOST_TEST(result
[1][1] == 1);
49 return boost::report_errors();