1 /* 2 Copyright 2017 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_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> 14 main()15int main() 16 { 17 { 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); 24 } 25 { 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); 32 } 33 { 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); 40 } 41 { 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); 48 } 49 return boost::report_errors(); 50 } 51 #else main()52int main() 53 { 54 return 0; 55 } 56 #endif 57