1 /* 2 Copyright 2012-2015 Glen Joseph Fernandes 3 (glenjofe@gmail.com) 4 5 Distributed under the Boost Software License, Version 1.0. 6 (http://www.boost.org/LICENSE_1_0.txt) 7 */ 8 #include <boost/config.hpp> 9 #if !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX) 10 #include <boost/core/lightweight_test.hpp> 11 #include <boost/smart_ptr/make_shared.hpp> 12 main()13int main() 14 { 15 { 16 boost::shared_ptr<int[][2]> result = 17 boost::make_shared<int[][2]>(2, {0, 1}); 18 BOOST_TEST(result[0][0] == 0); 19 BOOST_TEST(result[0][1] == 1); 20 BOOST_TEST(result[1][0] == 0); 21 BOOST_TEST(result[1][1] == 1); 22 } 23 { 24 boost::shared_ptr<int[2][2]> result = 25 boost::make_shared<int[2][2]>({0, 1}); 26 BOOST_TEST(result[0][0] == 0); 27 BOOST_TEST(result[0][1] == 1); 28 BOOST_TEST(result[1][0] == 0); 29 BOOST_TEST(result[1][1] == 1); 30 } 31 { 32 boost::shared_ptr<const int[][2]> result = 33 boost::make_shared<const int[][2]>(2, {0, 1}); 34 BOOST_TEST(result[0][0] == 0); 35 BOOST_TEST(result[0][1] == 1); 36 BOOST_TEST(result[1][0] == 0); 37 BOOST_TEST(result[1][1] == 1); 38 } 39 { 40 boost::shared_ptr<const int[2][2]> result = 41 boost::make_shared<const int[2][2]>({0, 1}); 42 BOOST_TEST(result[0][0] == 0); 43 BOOST_TEST(result[0][1] == 1); 44 BOOST_TEST(result[1][0] == 0); 45 BOOST_TEST(result[1][1] == 1); 46 } 47 return boost::report_errors(); 48 } 49 #else main()50int main() 51 { 52 return 0; 53 } 54 #endif 55