diff --git a/include/boost/smart_ptr/allocate_shared_array.hpp b/include/boost/smart_ptr/allocate_shared_array.hpp index f83c6e3..d860d05 100644 --- a/include/boost/smart_ptr/allocate_shared_array.hpp +++ b/include/boost/smart_ptr/allocate_shared_array.hpp @@ -58,19 +58,19 @@ namespace boost { allocate_shared(const A& allocator, size_t size, typename detail::array_list::type list) { typedef typename shared_ptr::element_type T1; typedef typename detail::array_type::type T2; - typedef const T1* L1; - typedef const T2* L2; + typedef const T2 T3; T1* p1 = 0; T2* p2 = 0; - L1 l1 = list.begin(); + T3* p3 = 0; size_t n1 = size * detail::array_size::size; detail::allocate_array_helper a1(allocator, n1, &p2); detail::array_deleter d1; shared_ptr s1(p1, d1, a1); detail::array_deleter* d2; + p3 = reinterpret_cast(list.begin()); p1 = reinterpret_cast(p2); d2 = get_deleter >(s1); - d2->construct(p2, n1, L2(l1)); + d2->construct(p2, n1, p3); return shared_ptr(s1, p1); } #endif diff --git a/include/boost/smart_ptr/make_shared_array.hpp b/include/boost/smart_ptr/make_shared_array.hpp index b19edf4..343ecfd 100644 --- a/include/boost/smart_ptr/make_shared_array.hpp +++ b/include/boost/smart_ptr/make_shared_array.hpp @@ -58,19 +58,19 @@ namespace boost { make_shared(std::size_t size, typename detail::array_list::type list) { typedef typename shared_ptr::element_type T1; typedef typename detail::array_type::type T2; - typedef const T1* L1; - typedef const T2* L2; + typedef const T2 T3; T1* p1 = 0; T2* p2 = 0; - L1 l1 = list.begin(); + T3* p3 = 0; size_t n1 = size * detail::array_size::size; detail::make_array_helper a1(n1, &p2); detail::array_deleter d1; shared_ptr s1(p1, d1, a1); - detail::array_deleter* d2; + detail::array_deleter* d2; + p3 = reinterpret_cast(list.begin()); p1 = reinterpret_cast(p2); d2 = get_deleter >(s1); - d2->construct(p2, n1, L2(l1)); + d2->construct(p2, n1, p3); return shared_ptr(s1, p1); } #endif