]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/smart_ptr/test/make_shared_arrays_test.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / smart_ptr / test / make_shared_arrays_test.cpp
CommitLineData
7c673cae
FG
1/*
2(c) 2012-2015 Glen Joseph Fernandes
3<glenjofe -at- gmail.com>
4
5Distributed under the Boost Software
6License, Version 1.0.
7http://boost.org/LICENSE_1_0.txt
8*/
9#include <boost/core/lightweight_test.hpp>
10#include <boost/smart_ptr/make_shared.hpp>
11
12int main()
13{
14#if !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX)
15 {
16 boost::shared_ptr<int[][2]> a1 = boost::make_shared<int[][2]>(2, {0, 1});
17 BOOST_TEST(a1[0][0] == 0);
18 BOOST_TEST(a1[0][1] == 1);
19 BOOST_TEST(a1[1][0] == 0);
20 BOOST_TEST(a1[1][1] == 1);
21 }
22 {
23 boost::shared_ptr<int[2][2]> a1 = boost::make_shared<int[2][2]>({ 0, 1 });
24 BOOST_TEST(a1[0][0] == 0);
25 BOOST_TEST(a1[0][1] == 1);
26 BOOST_TEST(a1[1][0] == 0);
27 BOOST_TEST(a1[1][1] == 1);
28 }
29 {
30 boost::shared_ptr<const int[][2]> a1 = boost::make_shared<const int[][2]>(2, { 0, 1 });
31 BOOST_TEST(a1[0][0] == 0);
32 BOOST_TEST(a1[0][1] == 1);
33 BOOST_TEST(a1[1][0] == 0);
34 BOOST_TEST(a1[1][1] == 1);
35 }
36 {
37 boost::shared_ptr<const int[2][2]> a1 = boost::make_shared<const int[2][2]>({ 0, 1 });
38 BOOST_TEST(a1[0][0] == 0);
39 BOOST_TEST(a1[0][1] == 1);
40 BOOST_TEST(a1[1][0] == 0);
41 BOOST_TEST(a1[1][1] == 1);
42 }
43#endif
44 return boost::report_errors();
45}