| 
									
										
										
										
											2012-11-07 14:42:10 +00:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2017-03-06 01:18:16 -05:00
										 |  |  | Copyright 2012-2015 Glen Joseph Fernandes | 
					
						
							|  |  |  | (glenjofe@gmail.com) | 
					
						
							| 
									
										
										
										
											2015-11-11 01:26:15 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-06 01:18:16 -05:00
										 |  |  | Distributed under the Boost Software License, Version 1.0. | 
					
						
							|  |  |  | (http://www.boost.org/LICENSE_1_0.txt)
 | 
					
						
							| 
									
										
										
										
											2015-11-11 01:26:15 -05:00
										 |  |  | */ | 
					
						
							| 
									
										
										
										
											2015-11-09 22:35:34 -05:00
										 |  |  | #include <boost/smart_ptr/make_shared.hpp>
 | 
					
						
							| 
									
										
										
										
											2024-09-25 18:08:57 +03:00
										 |  |  | #include <boost/core/lightweight_test.hpp>
 | 
					
						
							|  |  |  | #include <boost/config.hpp>
 | 
					
						
							| 
									
										
										
										
											2012-11-07 14:42:10 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-11-09 22:35:34 -05:00
										 |  |  | int main() | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2012-11-07 14:42:10 +00:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2017-03-06 01:18:16 -05:00
										 |  |  |         boost::shared_ptr<int[][2]> result = | 
					
						
							|  |  |  |             boost::make_shared<int[][2]>(2, {0, 1}); | 
					
						
							|  |  |  |         BOOST_TEST(result[0][0] == 0); | 
					
						
							|  |  |  |         BOOST_TEST(result[0][1] == 1); | 
					
						
							|  |  |  |         BOOST_TEST(result[1][0] == 0); | 
					
						
							|  |  |  |         BOOST_TEST(result[1][1] == 1); | 
					
						
							| 
									
										
										
										
											2012-11-07 14:42:10 +00:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-11-11 19:14:50 +00:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2017-03-06 01:18:16 -05:00
										 |  |  |         boost::shared_ptr<int[2][2]> result = | 
					
						
							|  |  |  |             boost::make_shared<int[2][2]>({0, 1}); | 
					
						
							|  |  |  |         BOOST_TEST(result[0][0] == 0); | 
					
						
							|  |  |  |         BOOST_TEST(result[0][1] == 1); | 
					
						
							|  |  |  |         BOOST_TEST(result[1][0] == 0); | 
					
						
							|  |  |  |         BOOST_TEST(result[1][1] == 1); | 
					
						
							| 
									
										
										
										
											2012-11-11 19:14:50 +00:00
										 |  |  |     } | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2017-03-06 01:18:16 -05:00
										 |  |  |         boost::shared_ptr<const int[][2]> result = | 
					
						
							|  |  |  |             boost::make_shared<const int[][2]>(2, {0, 1}); | 
					
						
							|  |  |  |         BOOST_TEST(result[0][0] == 0); | 
					
						
							|  |  |  |         BOOST_TEST(result[0][1] == 1); | 
					
						
							|  |  |  |         BOOST_TEST(result[1][0] == 0); | 
					
						
							|  |  |  |         BOOST_TEST(result[1][1] == 1); | 
					
						
							| 
									
										
										
										
											2012-11-11 19:14:50 +00:00
										 |  |  |     } | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2017-03-06 01:18:16 -05:00
										 |  |  |         boost::shared_ptr<const int[2][2]> result = | 
					
						
							|  |  |  |             boost::make_shared<const int[2][2]>({0, 1}); | 
					
						
							|  |  |  |         BOOST_TEST(result[0][0] == 0); | 
					
						
							|  |  |  |         BOOST_TEST(result[0][1] == 1); | 
					
						
							|  |  |  |         BOOST_TEST(result[1][0] == 0); | 
					
						
							|  |  |  |         BOOST_TEST(result[1][1] == 1); | 
					
						
							| 
									
										
										
										
											2012-11-11 19:14:50 +00:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-11-07 14:42:10 +00:00
										 |  |  |     return boost::report_errors(); | 
					
						
							|  |  |  | } |