From 016af907bdccc61e3415828c4efeeeb38765b36f Mon Sep 17 00:00:00 2001 From: Glen Fernandes Date: Wed, 12 Feb 2014 08:46:59 -0800 Subject: [PATCH] Make sp_counted_impl_ specialization more generic --- include/boost/smart_ptr/allocate_shared_array.hpp | 12 ++++++------ include/boost/smart_ptr/detail/array_allocator.hpp | 2 +- include/boost/smart_ptr/detail/array_count_impl.hpp | 9 ++++----- include/boost/smart_ptr/make_shared_array.hpp | 12 ++++++------ 4 files changed, 17 insertions(+), 18 deletions(-) diff --git a/include/boost/smart_ptr/allocate_shared_array.hpp b/include/boost/smart_ptr/allocate_shared_array.hpp index fdaec42..e64047f 100644 --- a/include/boost/smart_ptr/allocate_shared_array.hpp +++ b/include/boost/smart_ptr/allocate_shared_array.hpp @@ -20,7 +20,7 @@ namespace boost { typedef typename boost::detail::array_base::type T2; typedef boost::detail::ms_init_tag R1; typedef boost::detail::ms_allocator A1; - typedef boost::detail::ms_noop D1; + typedef boost::detail::ms_in_allocator_tag D1; std::size_t n1 = size * boost::detail::array_total::size; T1* p1 = 0; T2* p2 = 0; @@ -45,7 +45,7 @@ namespace boost { typedef typename boost::detail::array_base::type T2; typedef boost::detail::ms_init_tag R1; typedef boost::detail::ms_allocator A1; - typedef boost::detail::ms_noop D1; + typedef boost::detail::ms_in_allocator_tag D1; enum { N = boost::detail::array_total::size }; @@ -74,7 +74,7 @@ namespace boost { typedef const T2 T3; typedef boost::detail::ms_init_tag R1; typedef boost::detail::ms_allocator A1; - typedef boost::detail::ms_noop D1; + typedef boost::detail::ms_in_allocator_tag D1; enum { M = boost::detail::array_total::size }; @@ -105,7 +105,7 @@ namespace boost { typedef const T2 T3; typedef boost::detail::ms_init_tag R1; typedef boost::detail::ms_allocator A1; - typedef boost::detail::ms_noop D1; + typedef boost::detail::ms_in_allocator_tag D1; enum { N = boost::detail::array_total::size, M = boost::detail::array_total::size @@ -134,7 +134,7 @@ namespace boost { typedef typename boost::detail::array_base::type T2; typedef boost::detail::ms_noinit_tag R1; typedef boost::detail::ms_allocator A1; - typedef boost::detail::ms_noop D1; + typedef boost::detail::ms_in_allocator_tag D1; std::size_t n1 = size * boost::detail::array_total::size; T1* p1 = 0; T2* p2 = 0; @@ -155,7 +155,7 @@ namespace boost { typedef typename boost::detail::array_base::type T2; typedef boost::detail::ms_noinit_tag R1; typedef boost::detail::ms_allocator A1; - typedef boost::detail::ms_noop D1; + typedef boost::detail::ms_in_allocator_tag D1; enum { N = boost::detail::array_total::size }; diff --git a/include/boost/smart_ptr/detail/array_allocator.hpp b/include/boost/smart_ptr/detail/array_allocator.hpp index fc55504..ce918b9 100644 --- a/include/boost/smart_ptr/detail/array_allocator.hpp +++ b/include/boost/smart_ptr/detail/array_allocator.hpp @@ -372,7 +372,7 @@ namespace boost { type* object; }; - class ms_noop { + class ms_in_allocator_tag { public: void operator()(const void*) { } diff --git a/include/boost/smart_ptr/detail/array_count_impl.hpp b/include/boost/smart_ptr/detail/array_count_impl.hpp index 503947e..f81954d 100644 --- a/include/boost/smart_ptr/detail/array_count_impl.hpp +++ b/include/boost/smart_ptr/detail/array_count_impl.hpp @@ -14,14 +14,13 @@ namespace boost { namespace detail { - template - class sp_counted_impl_pda > + template + class sp_counted_impl_pda : public sp_counted_base { - typedef ms_noop D; - typedef ms_allocator A; + typedef ms_in_allocator_tag D; typedef sp_counted_impl_pda Y; public: - sp_counted_impl_pda(const P&, const D&, const A& allocator_) + sp_counted_impl_pda(P, const D&, const A& allocator_) : allocator(allocator_) { } diff --git a/include/boost/smart_ptr/make_shared_array.hpp b/include/boost/smart_ptr/make_shared_array.hpp index f98368a..362c3f8 100644 --- a/include/boost/smart_ptr/make_shared_array.hpp +++ b/include/boost/smart_ptr/make_shared_array.hpp @@ -20,7 +20,7 @@ namespace boost { typedef typename boost::detail::array_base::type T2; typedef boost::detail::ms_init_tag R1; typedef boost::detail::ms_allocator A1; - typedef boost::detail::ms_noop D1; + typedef boost::detail::ms_in_allocator_tag D1; std::size_t n1 = size * boost::detail::array_total::size; T1* p1 = 0; T2* p2 = 0; @@ -41,7 +41,7 @@ namespace boost { typedef typename boost::detail::array_base::type T2; typedef boost::detail::ms_init_tag R1; typedef boost::detail::ms_allocator A1; - typedef boost::detail::ms_noop D1; + typedef boost::detail::ms_in_allocator_tag D1; enum { N = boost::detail::array_total::size }; @@ -66,7 +66,7 @@ namespace boost { typedef const T2 T3; typedef boost::detail::ms_init_tag R1; typedef boost::detail::ms_allocator A1; - typedef boost::detail::ms_noop D1; + typedef boost::detail::ms_in_allocator_tag D1; enum { M = boost::detail::array_total::size }; @@ -92,7 +92,7 @@ namespace boost { typedef const T2 T3; typedef boost::detail::ms_init_tag R1; typedef boost::detail::ms_allocator A1; - typedef boost::detail::ms_noop D1; + typedef boost::detail::ms_in_allocator_tag D1; enum { M = boost::detail::array_total::size, N = boost::detail::array_total::size @@ -117,7 +117,7 @@ namespace boost { typedef typename boost::detail::array_base::type T2; typedef boost::detail::ms_noinit_tag R1; typedef boost::detail::ms_allocator A1; - typedef boost::detail::ms_noop D1; + typedef boost::detail::ms_in_allocator_tag D1; std::size_t n1 = size * boost::detail::array_total::size; T1* p1 = 0; T2* p2 = 0; @@ -138,7 +138,7 @@ namespace boost { typedef typename boost::detail::array_base::type T2; typedef boost::detail::ms_noinit_tag R1; typedef boost::detail::ms_allocator A1; - typedef boost::detail::ms_noop D1; + typedef boost::detail::ms_in_allocator_tag D1; enum { N = boost::detail::array_total::size };