mirror of
				https://github.com/boostorg/smart_ptr.git
				synced 2025-11-04 01:31:51 +01:00 
			
		
		
		
	Merged revision(s) 81341-81342 from trunk:
Add additional overload for allocate_shared and make_shared array forms that take initializer list of T for the array types T[M][N] ........ Minor style change: Fix indentation in allocate_shared_array.hpp and make_shared_array.hpp ........ [SVN r81366]
This commit is contained in:
		@@ -25,6 +25,13 @@ int main() {
 | 
			
		||||
        BOOST_TEST(a1[1][0] == 2);
 | 
			
		||||
        BOOST_TEST(a1[1][1] == 3);
 | 
			
		||||
    }
 | 
			
		||||
    {
 | 
			
		||||
        boost::shared_ptr<int[2][2]> a1 = boost::allocate_shared<int[2][2]>(std::allocator<int>(), {0, 1});
 | 
			
		||||
        BOOST_TEST(a1[0][0] == 0);
 | 
			
		||||
        BOOST_TEST(a1[0][1] == 1);
 | 
			
		||||
        BOOST_TEST(a1[1][0] == 0);
 | 
			
		||||
        BOOST_TEST(a1[1][1] == 1);
 | 
			
		||||
    }
 | 
			
		||||
    {
 | 
			
		||||
        boost::shared_ptr<int[][2]> a1 = boost::allocate_shared<int[][2]>(std::allocator<int>(), 2, {0, 1});
 | 
			
		||||
        BOOST_TEST(a1[0][0] == 0);
 | 
			
		||||
@@ -39,6 +46,13 @@ int main() {
 | 
			
		||||
        BOOST_TEST(a1[1][1][0] == 2);
 | 
			
		||||
        BOOST_TEST(a1[1][1][1] == 3);
 | 
			
		||||
    }
 | 
			
		||||
    {
 | 
			
		||||
        boost::shared_ptr<int[2][2][2]> a1 = boost::allocate_shared<int[2][2][2]>(std::allocator<int>(), { {0, 1}, {2, 3} });
 | 
			
		||||
        BOOST_TEST(a1[0][0][0] == 0);
 | 
			
		||||
        BOOST_TEST(a1[0][0][1] == 1);
 | 
			
		||||
        BOOST_TEST(a1[1][1][0] == 2);
 | 
			
		||||
        BOOST_TEST(a1[1][1][1] == 3);
 | 
			
		||||
    }
 | 
			
		||||
#endif
 | 
			
		||||
    return boost::report_errors();
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user