]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | /* |
2 | (c) 2012-2015 Glen Joseph Fernandes | |
3 | <glenjofe -at- gmail.com> | |
4 | ||
5 | Distributed under the Boost Software | |
6 | License, Version 1.0. | |
7 | http://boost.org/LICENSE_1_0.txt | |
8 | */ | |
9 | #include <boost/core/lightweight_test.hpp> | |
10 | #include <boost/smart_ptr/make_shared.hpp> | |
11 | ||
12 | int 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 | } |