Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r81276 - in trunk/boost/smart_ptr: . detail
From: glenfe_at_[hidden]
Date: 2012-11-09 21:17:03


Author: glenfe
Date: 2012-11-09 21:17:02 EST (Fri, 09 Nov 2012)
New Revision: 81276
URL: http://svn.boost.org/trac/boost/changeset/81276

Log:
Change traits for initializer list for g++
Text files modified:
   trunk/boost/smart_ptr/allocate_shared_array.hpp | 9 ++++++---
   trunk/boost/smart_ptr/detail/array_traits.hpp | 26 +++++---------------------
   trunk/boost/smart_ptr/make_shared_array.hpp | 9 ++++++---
   3 files changed, 17 insertions(+), 27 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-11-09 21:17:02 EST (Fri, 09 Nov 2012)
@@ -14,6 +14,9 @@
 #include <boost/smart_ptr/detail/array_deleter.hpp>
 #include <boost/smart_ptr/detail/array_traits.hpp>
 #include <boost/smart_ptr/detail/sp_if_array.hpp>
+#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
+#include <initializer_list>
+#endif
 
 namespace boost {
     template<typename T, typename A>
@@ -72,7 +75,7 @@
 #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
     template<typename T, typename A>
     inline typename detail::sp_if_array<T>::type
- allocate_shared(const A& allocator, typename detail::array_list<T>::type list) {
+ allocate_shared(const A& allocator, std::initializer_list<typename detail::array_inner<T>::type> list) {
         typedef typename detail::array_inner<T>::type T1;
         typedef typename detail::array_base<T1>::type T2;
         typedef const T2 T3;
@@ -92,7 +95,7 @@
     }
     template<typename T, typename A>
     inline typename detail::sp_if_size_array<T>::type
- allocate_shared(const A& allocator, typename detail::array_list<T>::type list) {
+ allocate_shared(const A& allocator, std::initializer_list<typename detail::array_inner<T>::type> list) {
         BOOST_ASSERT(list.size() == detail::array_size<T>::size);
         typedef typename detail::array_inner<T>::type T1;
         typedef typename detail::array_base<T1>::type T2;
@@ -113,7 +116,7 @@
     }
     template<typename T, typename A>
     inline typename detail::sp_if_array<T>::type
- allocate_shared(const A& allocator, std::size_t size, typename detail::inner_list<T>::type list) {
+ allocate_shared(const A& allocator, std::size_t size, std::initializer_list<typename detail::arrays_inner<T>::type> list) {
         typedef typename detail::array_inner<T>::type T1;
         typedef typename detail::array_base<T1>::type T2;
         typedef const T2 T3;

Modified: trunk/boost/smart_ptr/detail/array_traits.hpp
==============================================================================
--- trunk/boost/smart_ptr/detail/array_traits.hpp (original)
+++ trunk/boost/smart_ptr/detail/array_traits.hpp 2012-11-09 21:17:02 EST (Fri, 09 Nov 2012)
@@ -10,9 +10,6 @@
 #define BOOST_SMART_PTR_DETAIL_ARRAY_TRAITS_HPP
 
 #include <boost/type_traits/remove_cv.hpp>
-#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
-#include <initializer_list>
-#endif
 
 namespace boost {
     namespace detail {
@@ -56,26 +53,13 @@
         struct array_inner<T[N]> {
             typedef T type;
         };
-#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
- template<typename T>
- struct array_list {
- };
- template<typename T>
- struct array_list<T[]> {
- typedef std::initializer_list<T> type;
- };
- template<typename T, size_t N>
- struct array_list<T[N]> {
- typedef std::initializer_list<T> type;
- };
- template<typename T>
- struct inner_list {
+ template<typename T>
+ struct arrays_inner {
         };
- template<typename T, size_t N>
- struct inner_list<T[][N]> {
- typedef std::initializer_list<T> type;
+ template<typename T, size_t N>
+ struct arrays_inner<T[][N]> {
+ typedef T type;
         };
-#endif
     }
 }
 

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-11-09 21:17:02 EST (Fri, 09 Nov 2012)
@@ -14,6 +14,9 @@
 #include <boost/smart_ptr/detail/array_traits.hpp>
 #include <boost/smart_ptr/detail/make_array_helper.hpp>
 #include <boost/smart_ptr/detail/sp_if_array.hpp>
+#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
+#include <initializer_list>
+#endif
 
 namespace boost {
     template<typename T>
@@ -72,7 +75,7 @@
 #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
     template<typename T>
     inline typename detail::sp_if_array<T>::type
- make_shared(typename detail::array_list<T>::type list) {
+ make_shared(std::initializer_list<typename detail::array_inner<T>::type> list) {
         typedef typename detail::array_inner<T>::type T1;
         typedef typename detail::array_base<T1>::type T2;
         typedef const T2 T3;
@@ -92,7 +95,7 @@
     }
     template<typename T>
     inline typename detail::sp_if_size_array<T>::type
- make_shared(typename detail::array_list<T>::type list) {
+ make_shared(std::initializer_list<typename detail::array_inner<T>::type> list) {
         BOOST_ASSERT(list.size() == detail::array_size<T>::size);
         typedef typename detail::array_inner<T>::type T1;
         typedef typename detail::array_base<T1>::type T2;
@@ -113,7 +116,7 @@
     }
     template<typename T>
     inline typename detail::sp_if_array<T>::type
- make_shared(std::size_t size, typename detail::inner_list<T>::type list) {
+ make_shared(std::size_t size, std::initializer_list<typename detail::arrays_inner<T>::type> list) {
         typedef typename detail::array_inner<T>::type T1;
         typedef typename detail::array_base<T1>::type T2;
         typedef const T2 T3;


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