Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r81642 - in trunk: boost/smart_ptr libs/smart_ptr libs/smart_ptr/test
From: glenfe_at_[hidden]
Date: 2012-12-01 00:23:39


Author: glenfe
Date: 2012-12-01 00:23:37 EST (Sat, 01 Dec 2012)
New Revision: 81642
URL: http://svn.boost.org/trac/boost/changeset/81642

Log:
Use BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX instead for certain overloads of make_shared and allocate_shared
Text files modified:
   trunk/boost/smart_ptr/allocate_shared_array.hpp | 42 ++++++++++++++++++++------------------
   trunk/boost/smart_ptr/make_shared_array.hpp | 42 ++++++++++++++++++++------------------
   trunk/libs/smart_ptr/make_shared_array.html | 22 ++++++++++---------
   trunk/libs/smart_ptr/test/allocate_shared_array_init_test.cpp | 34 ++++++++++++++++--------------
   trunk/libs/smart_ptr/test/allocate_shared_arrays_create_test.cpp | 44 ++++++++++++++++++++-------------------
   trunk/libs/smart_ptr/test/make_shared_array_init_test.cpp | 34 ++++++++++++++++--------------
   trunk/libs/smart_ptr/test/make_shared_arrays_create_test.cpp | 44 ++++++++++++++++++++-------------------
   7 files changed, 138 insertions(+), 124 deletions(-)

Modified: trunk/boost/smart_ptr/allocate_shared_array.hpp
==============================================================================
--- trunk/boost/smart_ptr/allocate_shared_array.hpp (original)
+++ trunk/boost/smart_ptr/allocate_shared_array.hpp 2012-12-01 00:23:37 EST (Sat, 01 Dec 2012)
@@ -98,49 +98,51 @@
         return boost::shared_ptr<T>(s1, p1);
     }
     template<typename T, typename A>
- inline typename boost::detail::sp_if_size_array<T>::type
- allocate_shared(const A& allocator, const T& list) {
+ inline typename boost::detail::sp_if_array<T>::type
+ allocate_shared(const A& allocator, std::size_t size,
+ std::initializer_list<typename boost::detail::arrays_inner<T>::type> list) {
         typedef typename boost::detail::array_inner<T>::type T1;
         typedef typename boost::detail::array_base<T1>::type T2;
         typedef const T2 T3;
         enum {
- N = boost::detail::array_total<T>::size
+ M = boost::detail::array_total<T1>::size
         };
         T1* p1 = 0;
         T2* p2 = 0;
         T3* p3 = 0;
- boost::detail::allocate_array_helper<A, T2[N]> a1(allocator, &p2);
- boost::detail::array_deleter<T2[N]> d1;
+ std::size_t n1 = M * list.size();
+ boost::detail::allocate_array_helper<A, T2[]> a1(allocator, n1, &p2);
+ boost::detail::array_deleter<T2[]> d1;
         boost::shared_ptr<T> s1(p1, d1, a1);
- boost::detail::array_deleter<T2[N]>* d2;
- p3 = reinterpret_cast<T3*>(list);
+ boost::detail::array_deleter<T2[]>* d2;
+ p3 = reinterpret_cast<T3*>(list.begin());
         p1 = reinterpret_cast<T1*>(p2);
- d2 = get_deleter<boost::detail::array_deleter<T2[N]> >(s1);
- d2->construct_list(p2, p3);
+ d2 = get_deleter<boost::detail::array_deleter<T2[]> >(s1);
+ d2->construct_list(p2, n1, p3, M);
         return boost::shared_ptr<T>(s1, p1);
     }
+#endif
+#ifndef BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
     template<typename T, typename A>
- inline typename boost::detail::sp_if_array<T>::type
- allocate_shared(const A& allocator, std::size_t size,
- std::initializer_list<typename boost::detail::arrays_inner<T>::type> list) {
+ inline typename boost::detail::sp_if_size_array<T>::type
+ allocate_shared(const A& allocator, const T& list) {
         typedef typename boost::detail::array_inner<T>::type T1;
         typedef typename boost::detail::array_base<T1>::type T2;
         typedef const T2 T3;
         enum {
- M = boost::detail::array_total<T1>::size
+ N = boost::detail::array_total<T>::size
         };
         T1* p1 = 0;
         T2* p2 = 0;
         T3* p3 = 0;
- std::size_t n1 = M * list.size();
- boost::detail::allocate_array_helper<A, T2[]> a1(allocator, n1, &p2);
- boost::detail::array_deleter<T2[]> d1;
+ boost::detail::allocate_array_helper<A, T2[N]> a1(allocator, &p2);
+ boost::detail::array_deleter<T2[N]> d1;
         boost::shared_ptr<T> s1(p1, d1, a1);
- boost::detail::array_deleter<T2[]>* d2;
- p3 = reinterpret_cast<T3*>(list.begin());
+ boost::detail::array_deleter<T2[N]>* d2;
+ p3 = reinterpret_cast<T3*>(list);
         p1 = reinterpret_cast<T1*>(p2);
- d2 = get_deleter<boost::detail::array_deleter<T2[]> >(s1);
- d2->construct_list(p2, n1, p3, M);
+ d2 = get_deleter<boost::detail::array_deleter<T2[N]> >(s1);
+ d2->construct_list(p2, p3);
         return boost::shared_ptr<T>(s1, p1);
     }
     template<typename T, typename A>

Modified: trunk/boost/smart_ptr/make_shared_array.hpp
==============================================================================
--- trunk/boost/smart_ptr/make_shared_array.hpp (original)
+++ trunk/boost/smart_ptr/make_shared_array.hpp 2012-12-01 00:23:37 EST (Sat, 01 Dec 2012)
@@ -97,49 +97,51 @@
         return boost::shared_ptr<T>(s1, p1);
     }
     template<typename T>
- inline typename boost::detail::sp_if_size_array<T>::type
- make_shared(const T& list) {
+ inline typename boost::detail::sp_if_array<T>::type
+ make_shared(std::size_t size,
+ std::initializer_list<typename boost::detail::arrays_inner<T>::type> list) {
         typedef typename boost::detail::array_inner<T>::type T1;
         typedef typename boost::detail::array_base<T1>::type T2;
         typedef const T2 T3;
         enum {
- N = boost::detail::array_total<T>::size
+ M = boost::detail::array_total<T1>::size
         };
         T1* p1 = 0;
         T2* p2 = 0;
         T3* p3 = 0;
- boost::detail::make_array_helper<T2[N]> a1(&p2);
- boost::detail::array_deleter<T2[N]> d1;
+ std::size_t n1 = M * size;
+ boost::detail::make_array_helper<T2[]> a1(n1, &p2);
+ boost::detail::array_deleter<T2[]> d1;
         boost::shared_ptr<T> s1(p1, d1, a1);
- boost::detail::array_deleter<T2[N]>* d2;
- p3 = reinterpret_cast<T3*>(list);
+ boost::detail::array_deleter<T2[]>* d2;
+ p3 = reinterpret_cast<T3*>(list.begin());
         p1 = reinterpret_cast<T1*>(p2);
- d2 = get_deleter<boost::detail::array_deleter<T2[N]> >(s1);
- d2->construct_list(p2, p3);
+ d2 = get_deleter<boost::detail::array_deleter<T2[]> >(s1);
+ d2->construct_list(p2, n1, p3, M);
         return boost::shared_ptr<T>(s1, p1);
     }
+#endif
+#ifndef BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
     template<typename T>
- inline typename boost::detail::sp_if_array<T>::type
- make_shared(std::size_t size,
- std::initializer_list<typename boost::detail::arrays_inner<T>::type> list) {
+ inline typename boost::detail::sp_if_size_array<T>::type
+ make_shared(const T& list) {
         typedef typename boost::detail::array_inner<T>::type T1;
         typedef typename boost::detail::array_base<T1>::type T2;
         typedef const T2 T3;
         enum {
- M = boost::detail::array_total<T1>::size
+ N = boost::detail::array_total<T>::size
         };
         T1* p1 = 0;
         T2* p2 = 0;
         T3* p3 = 0;
- std::size_t n1 = M * size;
- boost::detail::make_array_helper<T2[]> a1(n1, &p2);
- boost::detail::array_deleter<T2[]> d1;
+ boost::detail::make_array_helper<T2[N]> a1(&p2);
+ boost::detail::array_deleter<T2[N]> d1;
         boost::shared_ptr<T> s1(p1, d1, a1);
- boost::detail::array_deleter<T2[]>* d2;
- p3 = reinterpret_cast<T3*>(list.begin());
+ boost::detail::array_deleter<T2[N]>* d2;
+ p3 = reinterpret_cast<T3*>(list);
         p1 = reinterpret_cast<T1*>(p2);
- d2 = get_deleter<boost::detail::array_deleter<T2[]> >(s1);
- d2->construct_list(p2, n1, p3, M);
+ d2 = get_deleter<boost::detail::array_deleter<T2[N]> >(s1);
+ d2->construct_list(p2, p3);
         return boost::shared_ptr<T>(s1, p1);
     }
     template<typename T>

Modified: trunk/libs/smart_ptr/make_shared_array.html
==============================================================================
--- trunk/libs/smart_ptr/make_shared_array.html (original)
+++ trunk/libs/smart_ptr/make_shared_array.html 2012-12-01 00:23:37 EST (Sat, 01 Dec 2012)
@@ -34,7 +34,7 @@
 
     template&lt;typename T, typename A&gt;
     shared_ptr&lt;T[]&gt; allocate_shared(const A&amp; allocator, size_t size);
-
+
 #if defined(BOOST_HAS_VARIADIC_TMPL) &amp;&amp; defined(BOOST_HAS_RVALUE_REFS)
     template&lt;typename T, typename... Args&gt;
     shared_ptr&lt;T[]&gt; make_shared(size_t size, Args&amp;&amp;... args);
@@ -48,28 +48,30 @@
     template&lt;typename T, typename A, typename... Args&gt;
     shared_ptr&lt;T[N]&gt; allocate_shared(const A&amp; allocator, Args&amp;&amp;... args);
 #endif
-
+
 #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
     template&lt;typename T, typename... Args&gt;
     shared_ptr&lt;T[]&gt; make_shared(initializer_list&lt;T&gt; list);
 
     template&lt;typename T, typename... Args&gt;
- shared_ptr&lt;T[N]&gt; make_shared(const T (&amp;list)[N]);
-
- template&lt;typename T, typename... Args&gt;
     shared_ptr&lt;T[][N]&gt; make_shared(size_t size, initializer_list&lt;T&gt; list);
 
- template&lt;typename T, typename... Args&gt;
- shared_ptr&lt;T[M][N]&gt; make_shared(const T (&amp;list)[N]);
-
     template&lt;typename T, typename A, typename... Args&gt;
     shared_ptr&lt;T[]&gt; allocate_shared(const A&amp; allocator, initializer_list&lt;T&gt; list);
 
     template&lt;typename T, typename A, typename... Args&gt;
- shared_ptr&lt;T[N]&gt; allocate_shared(const A&amp; allocator, const T (&amp;list)[N]);
+ shared_ptr&lt;T[][N]&gt; allocate_shared(const A&amp; allocator, size_t size, initializer_list&lt;T&gt; list);
+#endif
+
+#ifndef BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
+ template&lt;typename T, typename... Args&gt;
+ shared_ptr&lt;T[N]&gt; make_shared(const T (&amp;list)[N]);
+
+ template&lt;typename T, typename... Args&gt;
+ shared_ptr&lt;T[M][N]&gt; make_shared(const T (&amp;list)[N]);
 
     template&lt;typename T, typename A, typename... Args&gt;
- shared_ptr&lt;T[][N]&gt; allocate_shared(const A&amp; allocator, size_t size, initializer_list&lt;T&gt; list);
+ shared_ptr&lt;T[N]&gt; allocate_shared(const A&amp; allocator, const T (&amp;list)[N]);
 
     template&lt;typename T, typename A, typename... Args&gt;
     shared_ptr&lt;T[M][N]&gt; allocate_shared(const A&amp; allocator, const T (&amp;list)[N]);

Modified: trunk/libs/smart_ptr/test/allocate_shared_array_init_test.cpp
==============================================================================
--- trunk/libs/smart_ptr/test/allocate_shared_array_init_test.cpp (original)
+++ trunk/libs/smart_ptr/test/allocate_shared_array_init_test.cpp 2012-12-01 00:23:37 EST (Sat, 01 Dec 2012)
@@ -29,13 +29,6 @@
         BOOST_TEST(a1[3] == 3);
     }
     {
- boost::shared_ptr<int[4]> a1 = boost::allocate_shared<int[4]>(std::allocator<int>(), { 0, 1, 2, 3 });
- BOOST_TEST(a1[0] == 0);
- BOOST_TEST(a1[1] == 1);
- BOOST_TEST(a1[2] == 2);
- BOOST_TEST(a1[3] == 3);
- }
- {
         boost::shared_ptr<const int[]> a1 = boost::allocate_shared<const int[]>(std::allocator<int>(), { 0, 1, 2, 3 });
         BOOST_TEST(a1[0] == 0);
         BOOST_TEST(a1[1] == 1);
@@ -43,13 +36,6 @@
         BOOST_TEST(a1[3] == 3);
     }
     {
- boost::shared_ptr<const int[4]> a1 = boost::allocate_shared<const int[4]>(std::allocator<int>(), { 0, 1, 2, 3 });
- BOOST_TEST(a1[0] == 0);
- BOOST_TEST(a1[1] == 1);
- BOOST_TEST(a1[2] == 2);
- BOOST_TEST(a1[3] == 3);
- }
- {
         boost::shared_ptr<type[]> a1 = boost::allocate_shared<type[]>(std::allocator<type>(), { 0, 1, 2, 3 });
         BOOST_TEST(a1[0].value == 0);
         BOOST_TEST(a1[1].value == 1);
@@ -57,14 +43,30 @@
         BOOST_TEST(a1[3].value == 3);
     }
     {
- boost::shared_ptr<type[4]> a1 = boost::allocate_shared<type[4]>(std::allocator<type>(), { 0, 1, 2, 3 });
+ boost::shared_ptr<const type[]> a1 = boost::allocate_shared<const type[]>(std::allocator<type>(), { 0, 1, 2, 3 });
         BOOST_TEST(a1[0].value == 0);
         BOOST_TEST(a1[1].value == 1);
         BOOST_TEST(a1[2].value == 2);
         BOOST_TEST(a1[3].value == 3);
     }
+#endif
+#ifndef BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
     {
- boost::shared_ptr<const type[]> a1 = boost::allocate_shared<const type[]>(std::allocator<type>(), { 0, 1, 2, 3 });
+ boost::shared_ptr<int[4]> a1 = boost::allocate_shared<int[4]>(std::allocator<int>(), { 0, 1, 2, 3 });
+ BOOST_TEST(a1[0] == 0);
+ BOOST_TEST(a1[1] == 1);
+ BOOST_TEST(a1[2] == 2);
+ BOOST_TEST(a1[3] == 3);
+ }
+ {
+ boost::shared_ptr<const int[4]> a1 = boost::allocate_shared<const int[4]>(std::allocator<int>(), { 0, 1, 2, 3 });
+ BOOST_TEST(a1[0] == 0);
+ BOOST_TEST(a1[1] == 1);
+ BOOST_TEST(a1[2] == 2);
+ BOOST_TEST(a1[3] == 3);
+ }
+ {
+ boost::shared_ptr<type[4]> a1 = boost::allocate_shared<type[4]>(std::allocator<type>(), { 0, 1, 2, 3 });
         BOOST_TEST(a1[0].value == 0);
         BOOST_TEST(a1[1].value == 1);
         BOOST_TEST(a1[2].value == 2);

Modified: trunk/libs/smart_ptr/test/allocate_shared_arrays_create_test.cpp
==============================================================================
--- trunk/libs/smart_ptr/test/allocate_shared_arrays_create_test.cpp (original)
+++ trunk/libs/smart_ptr/test/allocate_shared_arrays_create_test.cpp 2012-12-01 00:23:37 EST (Sat, 01 Dec 2012)
@@ -19,13 +19,6 @@
         BOOST_TEST(a1[3] == 3);
     }
     {
- boost::shared_ptr<int[4]> a1 = boost::allocate_shared<int[4]>(std::allocator<int>(), {0, 1, 2, 3});
- BOOST_TEST(a1[0] == 0);
- BOOST_TEST(a1[1] == 1);
- BOOST_TEST(a1[2] == 2);
- BOOST_TEST(a1[3] == 3);
- }
- {
         boost::shared_ptr<int[][2]> a1 = boost::allocate_shared<int[][2]>(std::allocator<int>(), { {0, 1}, {2, 3} });
         BOOST_TEST(a1[0][0] == 0);
         BOOST_TEST(a1[0][1] == 1);
@@ -33,20 +26,6 @@
         BOOST_TEST(a1[1][1] == 3);
     }
     {
- boost::shared_ptr<int[2][2]> a1 = boost::allocate_shared<int[2][2]>(std::allocator<int>(), { {0, 1}, {2, 3} });
- BOOST_TEST(a1[0][0] == 0);
- BOOST_TEST(a1[0][1] == 1);
- 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);
         BOOST_TEST(a1[0][1] == 1);
@@ -60,6 +39,29 @@
         BOOST_TEST(a1[1][1][0] == 2);
         BOOST_TEST(a1[1][1][1] == 3);
     }
+#endif
+#ifndef BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
+ {
+ boost::shared_ptr<int[4]> a1 = boost::allocate_shared<int[4]>(std::allocator<int>(), {0, 1, 2, 3});
+ BOOST_TEST(a1[0] == 0);
+ BOOST_TEST(a1[1] == 1);
+ BOOST_TEST(a1[2] == 2);
+ BOOST_TEST(a1[3] == 3);
+ }
+ {
+ boost::shared_ptr<int[2][2]> a1 = boost::allocate_shared<int[2][2]>(std::allocator<int>(), { {0, 1}, {2, 3} });
+ BOOST_TEST(a1[0][0] == 0);
+ BOOST_TEST(a1[0][1] == 1);
+ 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][2][2]> a1 = boost::allocate_shared<int[2][2][2]>(std::allocator<int>(), { {0, 1}, {2, 3} });
         BOOST_TEST(a1[0][0][0] == 0);

Modified: trunk/libs/smart_ptr/test/make_shared_array_init_test.cpp
==============================================================================
--- trunk/libs/smart_ptr/test/make_shared_array_init_test.cpp (original)
+++ trunk/libs/smart_ptr/test/make_shared_array_init_test.cpp 2012-12-01 00:23:37 EST (Sat, 01 Dec 2012)
@@ -29,13 +29,6 @@
         BOOST_TEST(a1[3] == 3);
     }
     {
- boost::shared_ptr<int[4]> a1 = boost::make_shared<int[4]>({ 0, 1, 2, 3 });
- BOOST_TEST(a1[0] == 0);
- BOOST_TEST(a1[1] == 1);
- BOOST_TEST(a1[2] == 2);
- BOOST_TEST(a1[3] == 3);
- }
- {
         boost::shared_ptr<const int[]> a1 = boost::make_shared<const int[]>({ 0, 1, 2, 3 });
         BOOST_TEST(a1[0] == 0);
         BOOST_TEST(a1[1] == 1);
@@ -43,13 +36,6 @@
         BOOST_TEST(a1[3] == 3);
     }
     {
- boost::shared_ptr<const int[4]> a1 = boost::make_shared<const int[4]>({ 0, 1, 2, 3 });
- BOOST_TEST(a1[0] == 0);
- BOOST_TEST(a1[1] == 1);
- BOOST_TEST(a1[2] == 2);
- BOOST_TEST(a1[3] == 3);
- }
- {
         boost::shared_ptr<type[]> a1 = boost::make_shared<type[]>({ 0, 1, 2, 3 });
         BOOST_TEST(a1[0].value == 0);
         BOOST_TEST(a1[1].value == 1);
@@ -57,14 +43,30 @@
         BOOST_TEST(a1[3].value == 3);
     }
     {
- boost::shared_ptr<type[4]> a1 = boost::make_shared<type[4]>({ 0, 1, 2, 3 });
+ boost::shared_ptr<const type[]> a1 = boost::make_shared<const type[]>({ 0, 1, 2, 3 });
         BOOST_TEST(a1[0].value == 0);
         BOOST_TEST(a1[1].value == 1);
         BOOST_TEST(a1[2].value == 2);
         BOOST_TEST(a1[3].value == 3);
     }
+#endif
+#ifndef BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
     {
- boost::shared_ptr<const type[]> a1 = boost::make_shared<const type[]>({ 0, 1, 2, 3 });
+ boost::shared_ptr<int[4]> a1 = boost::make_shared<int[4]>({ 0, 1, 2, 3 });
+ BOOST_TEST(a1[0] == 0);
+ BOOST_TEST(a1[1] == 1);
+ BOOST_TEST(a1[2] == 2);
+ BOOST_TEST(a1[3] == 3);
+ }
+ {
+ boost::shared_ptr<const int[4]> a1 = boost::make_shared<const int[4]>({ 0, 1, 2, 3 });
+ BOOST_TEST(a1[0] == 0);
+ BOOST_TEST(a1[1] == 1);
+ BOOST_TEST(a1[2] == 2);
+ BOOST_TEST(a1[3] == 3);
+ }
+ {
+ boost::shared_ptr<type[4]> a1 = boost::make_shared<type[4]>({ 0, 1, 2, 3 });
         BOOST_TEST(a1[0].value == 0);
         BOOST_TEST(a1[1].value == 1);
         BOOST_TEST(a1[2].value == 2);

Modified: trunk/libs/smart_ptr/test/make_shared_arrays_create_test.cpp
==============================================================================
--- trunk/libs/smart_ptr/test/make_shared_arrays_create_test.cpp (original)
+++ trunk/libs/smart_ptr/test/make_shared_arrays_create_test.cpp 2012-12-01 00:23:37 EST (Sat, 01 Dec 2012)
@@ -20,13 +20,6 @@
         BOOST_TEST(a1[3] == 3);
     }
     {
- boost::shared_ptr<int[4]> a1 = boost::make_shared<int[4]>({0, 1, 2, 3});
- BOOST_TEST(a1[0] == 0);
- BOOST_TEST(a1[1] == 1);
- BOOST_TEST(a1[2] == 2);
- BOOST_TEST(a1[3] == 3);
- }
- {
         boost::shared_ptr<int[][2]> a1 = boost::make_shared<int[][2]>({ {0, 1}, {2, 3} });
         BOOST_TEST(a1[0][0] == 0);
         BOOST_TEST(a1[0][1] == 1);
@@ -34,20 +27,6 @@
         BOOST_TEST(a1[1][1] == 3);
     }
     {
- boost::shared_ptr<int[2][2]> a1 = boost::make_shared<int[2][2]>({ {0, 1}, {2, 3} });
- BOOST_TEST(a1[0][0] == 0);
- BOOST_TEST(a1[0][1] == 1);
- BOOST_TEST(a1[1][0] == 2);
- BOOST_TEST(a1[1][1] == 3);
- }
- {
- boost::shared_ptr<int[2][2]> a1 = boost::make_shared<int[2][2]>({ 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::make_shared<int[][2]>(2, {0, 1});
         BOOST_TEST(a1[0][0] == 0);
         BOOST_TEST(a1[0][1] == 1);
@@ -61,6 +40,29 @@
         BOOST_TEST(a1[1][1][0] == 2);
         BOOST_TEST(a1[1][1][1] == 3);
     }
+#endif
+#ifndef BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
+ {
+ boost::shared_ptr<int[4]> a1 = boost::make_shared<int[4]>({0, 1, 2, 3});
+ BOOST_TEST(a1[0] == 0);
+ BOOST_TEST(a1[1] == 1);
+ BOOST_TEST(a1[2] == 2);
+ BOOST_TEST(a1[3] == 3);
+ }
+ {
+ boost::shared_ptr<int[2][2]> a1 = boost::make_shared<int[2][2]>({ {0, 1}, {2, 3} });
+ BOOST_TEST(a1[0][0] == 0);
+ BOOST_TEST(a1[0][1] == 1);
+ BOOST_TEST(a1[1][0] == 2);
+ BOOST_TEST(a1[1][1] == 3);
+ }
+ {
+ boost::shared_ptr<int[2][2]> a1 = boost::make_shared<int[2][2]>({ 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][2][2]> a1 = boost::make_shared<int[2][2][2]>({ {0, 1}, {2, 3} });
         BOOST_TEST(a1[0][0][0] == 0);


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk