|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r81409 - in trunk/boost/smart_ptr: . detail
From: glenfe_at_[hidden]
Date: 2012-11-17 21:51:07
Author: glenfe
Date: 2012-11-17 21:51:06 EST (Sat, 17 Nov 2012)
New Revision: 81409
URL: http://svn.boost.org/trac/boost/changeset/81409
Log:
Make make_shared_array.hpp and allocate_shared_array.hpp consistent with namespace qualification in rest of smart_ptr.
Text files modified:
trunk/boost/smart_ptr/allocate_shared_array.hpp | 164 ++++++++++++++++----------------
trunk/boost/smart_ptr/detail/allocate_array_helper.hpp | 4
trunk/boost/smart_ptr/detail/make_array_helper.hpp | 2
trunk/boost/smart_ptr/make_shared_array.hpp | 200 ++++++++++++++++++++--------------------
4 files changed, 185 insertions(+), 185 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-17 21:51:06 EST (Sat, 17 Nov 2012)
@@ -13,154 +13,154 @@
#include <boost/smart_ptr/detail/allocate_array_helper.hpp>
#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>
#include <boost/smart_ptr/detail/sp_forward.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>
- inline typename detail::sp_if_array<T>::type
+ inline typename boost::detail::sp_if_array<T>::type
allocate_shared(const A& allocator, std::size_t size) {
- typedef typename detail::array_inner<T>::type T1;
- typedef typename detail::array_base<T1>::type T2;
+ typedef typename boost::detail::array_inner<T>::type T1;
+ typedef typename boost::detail::array_base<T1>::type T2;
T1* p1 = 0;
T2* p2 = 0;
- std::size_t n1 = size * detail::array_total<T1>::size;
- detail::allocate_array_helper<A, T2> a1(allocator, n1, &p2);
- detail::array_deleter<T2> d1;
- shared_ptr<T> s1(p1, d1, a1);
- detail::array_deleter<T2>* d2;
+ std::size_t n1 = size * boost::detail::array_total<T1>::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>* d2;
p1 = reinterpret_cast<T1*>(p2);
- d2 = get_deleter<detail::array_deleter<T2> >(s1);
+ d2 = get_deleter<boost::detail::array_deleter<T2> >(s1);
d2->construct(p2, n1);
- return shared_ptr<T>(s1, p1);
+ return boost::shared_ptr<T>(s1, p1);
}
#if defined(BOOST_HAS_VARIADIC_TMPL) && defined(BOOST_HAS_RVALUE_REFS)
template<typename T, typename A, typename... Args>
- inline typename detail::sp_if_array<T>::type
+ inline typename boost::detail::sp_if_array<T>::type
allocate_shared(const A& allocator, std::size_t size, Args&&... args) {
- typedef typename detail::array_inner<T>::type T1;
- typedef typename detail::array_base<T1>::type T2;
+ typedef typename boost::detail::array_inner<T>::type T1;
+ typedef typename boost::detail::array_base<T1>::type T2;
T1* p1 = 0;
T2* p2 = 0;
- std::size_t n1 = size * detail::array_total<T1>::size;
- detail::allocate_array_helper<A, T2> a1(allocator, n1, &p2);
- detail::array_deleter<T2> d1;
- shared_ptr<T> s1(p1, d1, a1);
- detail::array_deleter<T2>* d2;
- p1 = reinterpret_cast<T1*>(p2);
- d2 = get_deleter<detail::array_deleter<T2> >(s1);
- d2->construct(p2, n1, detail::sp_forward<Args>(args)...);
- return shared_ptr<T>(s1, p1);
+ std::size_t n1 = size * boost::detail::array_total<T1>::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>* d2;
+ p1 = reinterpret_cast<T1*>(p2);
+ d2 = get_deleter<boost::detail::array_deleter<T2> >(s1);
+ d2->construct(p2, n1, boost::detail::sp_forward<Args>(args)...);
+ return boost::shared_ptr<T>(s1, p1);
}
template<typename T, typename A, typename... Args>
- inline typename detail::sp_if_size_array<T>::type
+ inline typename boost::detail::sp_if_size_array<T>::type
allocate_shared(const A& allocator, Args&&... args) {
- typedef typename detail::array_inner<T>::type T1;
- typedef typename detail::array_base<T1>::type T2;
+ typedef typename boost::detail::array_inner<T>::type T1;
+ typedef typename boost::detail::array_base<T1>::type T2;
T1* p1 = 0;
T2* p2 = 0;
- std::size_t n1 = detail::array_total<T>::size;
- detail::allocate_array_helper<A, T2> a1(allocator, n1, &p2);
- detail::array_deleter<T2> d1;
- shared_ptr<T> s1(p1, d1, a1);
- detail::array_deleter<T2>* d2;
- p1 = reinterpret_cast<T1*>(p2);
- d2 = get_deleter<detail::array_deleter<T2> >(s1);
- d2->construct(p2, n1, detail::sp_forward<Args>(args)...);
- return shared_ptr<T>(s1, p1);
+ std::size_t n1 = boost::detail::array_total<T>::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>* d2;
+ p1 = reinterpret_cast<T1*>(p2);
+ d2 = get_deleter<boost::detail::array_deleter<T2> >(s1);
+ d2->construct(p2, n1, boost::detail::sp_forward<Args>(args)...);
+ return boost::shared_ptr<T>(s1, p1);
}
#endif
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
template<typename T, typename A>
- inline typename detail::sp_if_array<T>::type
+ inline typename boost::detail::sp_if_array<T>::type
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;
+ std::initializer_list<typename boost::detail::array_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;
T1* p1 = 0;
T2* p2 = 0;
T3* p3 = 0;
- std::size_t n1 = list.size() * detail::array_total<T1>::size;
- detail::allocate_array_helper<A, T2> a1(allocator, n1, &p2);
- detail::array_deleter<T2> d1;
- shared_ptr<T> s1(p1, d1, a1);
- detail::array_deleter<T2>* d2;
+ std::size_t n1 = list.size() * boost::detail::array_total<T1>::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>* d2;
p3 = reinterpret_cast<T3*>(list.begin());
p1 = reinterpret_cast<T1*>(p2);
- d2 = get_deleter<detail::array_deleter<T2> >(s1);
+ d2 = get_deleter<boost::detail::array_deleter<T2> >(s1);
d2->construct_list(p2, n1, p3);
- return shared_ptr<T>(s1, p1);
+ return boost::shared_ptr<T>(s1, p1);
}
template<typename T, typename A>
- inline typename detail::sp_if_size_array<T>::type
+ inline typename boost::detail::sp_if_size_array<T>::type
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;
+ std::initializer_list<typename boost::detail::array_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;
- BOOST_ASSERT(list.size() == detail::array_size<T>::size);
+ BOOST_ASSERT(list.size() == boost::detail::array_size<T>::size);
T1* p1 = 0;
T2* p2 = 0;
T3* p3 = 0;
- std::size_t n1 = detail::array_total<T>::size;
- detail::allocate_array_helper<A, T2> a1(allocator, n1, &p2);
- detail::array_deleter<T2> d1;
- shared_ptr<T> s1(p1, d1, a1);
- detail::array_deleter<T2>* d2;
+ std::size_t n1 = boost::detail::array_total<T>::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>* d2;
p3 = reinterpret_cast<T3*>(list.begin());
p1 = reinterpret_cast<T1*>(p2);
- d2 = get_deleter<detail::array_deleter<T2> >(s1);
+ d2 = get_deleter<boost::detail::array_deleter<T2> >(s1);
d2->construct_list(p2, n1, p3);
- return shared_ptr<T>(s1, p1);
+ return boost::shared_ptr<T>(s1, p1);
}
template<typename T, typename A>
- inline typename detail::sp_if_array<T>::type
+ inline typename boost::detail::sp_if_array<T>::type
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;
+ 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;
T1* p1 = 0;
T2* p2 = 0;
T3* p3 = 0;
- std::size_t n0 = detail::array_total<T1>::size;
+ std::size_t n0 = boost::detail::array_total<T1>::size;
std::size_t n1 = n0 * list.size();
- detail::allocate_array_helper<A, T2> a1(allocator, n1, &p2);
- detail::array_deleter<T2> d1;
- shared_ptr<T> s1(p1, d1, a1);
- detail::array_deleter<T2>* d2;
+ 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>* d2;
p3 = reinterpret_cast<T3*>(list.begin());
p1 = reinterpret_cast<T1*>(p2);
- d2 = get_deleter<detail::array_deleter<T2> >(s1);
+ d2 = get_deleter<boost::detail::array_deleter<T2> >(s1);
d2->construct_list(p2, n1, p3, n0);
- return shared_ptr<T>(s1, p1);
+ return boost::shared_ptr<T>(s1, p1);
}
template<typename T, typename A>
- inline typename detail::sp_if_size_array<T>::type
+ inline typename boost::detail::sp_if_size_array<T>::type
allocate_shared(const A& allocator,
- 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;
+ 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;
- BOOST_ASSERT(list.size() == detail::array_size<T1>::size);
+ BOOST_ASSERT(list.size() == boost::detail::array_size<T1>::size);
T1* p1 = 0;
T2* p2 = 0;
T3* p3 = 0;
- std::size_t n0 = detail::array_total<T1>::size;
- std::size_t n1 = detail::array_total<T>::size;
- detail::allocate_array_helper<A, T2> a1(allocator, n1, &p2);
- detail::array_deleter<T2> d1;
- shared_ptr<T> s1(p1, d1, a1);
- detail::array_deleter<T2>* d2;
+ std::size_t n0 = boost::detail::array_total<T1>::size;
+ std::size_t n1 = boost::detail::array_total<T>::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>* d2;
p3 = reinterpret_cast<T3*>(list.begin());
p1 = reinterpret_cast<T1*>(p2);
- d2 = get_deleter<detail::array_deleter<T2> >(s1);
+ d2 = get_deleter<boost::detail::array_deleter<T2> >(s1);
d2->construct_list(p2, n1, p3, n0);
- return shared_ptr<T>(s1, p1);
+ return boost::shared_ptr<T>(s1, p1);
}
#endif
}
Modified: trunk/boost/smart_ptr/detail/allocate_array_helper.hpp
==============================================================================
--- trunk/boost/smart_ptr/detail/allocate_array_helper.hpp (original)
+++ trunk/boost/smart_ptr/detail/allocate_array_helper.hpp 2012-11-17 21:51:06 EST (Sat, 17 Nov 2012)
@@ -57,7 +57,7 @@
return allocator.max_size();
}
pointer allocate(size_type count, const void* value = 0) {
- std::size_t a1 = alignment_of<T>::value;
+ std::size_t a1 = boost::alignment_of<T>::value;
std::size_t n1 = count * sizeof(Y) + a1 - 1;
char* p1 = A3(allocator).allocate(n1 + size, value);
char* p2 = p1 + n1;
@@ -68,7 +68,7 @@
return reinterpret_cast<Y*>(p1);
}
void deallocate(pointer memory, size_type count) {
- std::size_t a1 = alignment_of<T>::value;
+ std::size_t a1 = boost::alignment_of<T>::value;
std::size_t n1 = count * sizeof(Y) + a1 - 1;
char* p1 = reinterpret_cast<char*>(memory);
A3(allocator).deallocate(p1, n1 + size);
Modified: trunk/boost/smart_ptr/detail/make_array_helper.hpp
==============================================================================
--- trunk/boost/smart_ptr/detail/make_array_helper.hpp (original)
+++ trunk/boost/smart_ptr/detail/make_array_helper.hpp 2012-11-17 21:51:06 EST (Sat, 17 Nov 2012)
@@ -52,7 +52,7 @@
return static_cast<std::size_t>(-1) / sizeof(Y);
}
pointer allocate(size_type count, const void* = 0) {
- std::size_t a1 = alignment_of<T>::value;
+ std::size_t a1 = boost::alignment_of<T>::value;
std::size_t n1 = count * sizeof(Y) + a1 - 1;
void* p1 = ::operator new(n1 + size);
char* p2 = static_cast<char*>(p1) + n1;
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-17 21:51:06 EST (Sat, 17 Nov 2012)
@@ -13,186 +13,186 @@
#include <boost/smart_ptr/detail/array_deleter.hpp>
#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>
#include <boost/smart_ptr/detail/sp_forward.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>
- inline typename detail::sp_if_array<T>::type
+ inline typename boost::detail::sp_if_array<T>::type
make_shared(std::size_t size) {
- typedef typename detail::array_inner<T>::type T1;
- typedef typename detail::array_base<T1>::type T2;
+ typedef typename boost::detail::array_inner<T>::type T1;
+ typedef typename boost::detail::array_base<T1>::type T2;
T1* p1 = 0;
T2* p2 = 0;
- std::size_t n1 = size * detail::array_total<T1>::size;
- detail::make_array_helper<T2> a1(n1, &p2);
- detail::array_deleter<T2> d1;
- shared_ptr<T> s1(p1, d1, a1);
- detail::array_deleter<T2>* d2;
+ std::size_t n1 = size * boost::detail::array_total<T1>::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>* d2;
p1 = reinterpret_cast<T1*>(p2);
- d2 = get_deleter<detail::array_deleter<T2> >(s1);
+ d2 = get_deleter<boost::detail::array_deleter<T2> >(s1);
d2->construct(p2, n1);
- return shared_ptr<T>(s1, p1);
+ return boost::shared_ptr<T>(s1, p1);
}
#if defined(BOOST_HAS_VARIADIC_TMPL) && defined(BOOST_HAS_RVALUE_REFS)
template<typename T, typename... Args>
- inline typename detail::sp_if_array<T>::type
+ inline typename boost::detail::sp_if_array<T>::type
make_shared(std::size_t size, Args&&... args) {
- typedef typename detail::array_inner<T>::type T1;
- typedef typename detail::array_base<T1>::type T2;
+ typedef typename boost::detail::array_inner<T>::type T1;
+ typedef typename boost::detail::array_base<T1>::type T2;
T1* p1 = 0;
T2* p2 = 0;
- std::size_t n1 = size * detail::array_total<T1>::size;
- detail::make_array_helper<T2> a1(n1, &p2);
- detail::array_deleter<T2> d1;
- shared_ptr<T> s1(p1, d1, a1);
- detail::array_deleter<T2>* d2;
+ std::size_t n1 = size * boost::detail::array_total<T1>::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>* d2;
p1 = reinterpret_cast<T1*>(p2);
- d2 = get_deleter<detail::array_deleter<T2> >(s1);
- d2->construct(p2, n1, detail::sp_forward<Args>(args)...);
- return shared_ptr<T>(s1, p1);
+ d2 = get_deleter<boost::detail::array_deleter<T2> >(s1);
+ d2->construct(p2, n1, boost::detail::sp_forward<Args>(args)...);
+ return boost::shared_ptr<T>(s1, p1);
}
template<typename T, typename... Args>
- inline typename detail::sp_if_size_array<T>::type
+ inline typename boost::detail::sp_if_size_array<T>::type
make_shared(Args&&... args) {
- typedef typename detail::array_inner<T>::type T1;
- typedef typename detail::array_base<T1>::type T2;
+ typedef typename boost::detail::array_inner<T>::type T1;
+ typedef typename boost::detail::array_base<T1>::type T2;
T1* p1 = 0;
T2* p2 = 0;
- std::size_t n1 = detail::array_total<T>::size;
- detail::make_array_helper<T2> a1(n1, &p2);
- detail::array_deleter<T2> d1;
- shared_ptr<T> s1(p1, d1, a1);
- detail::array_deleter<T2>* d2;
+ std::size_t n1 = boost::detail::array_total<T>::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>* d2;
p1 = reinterpret_cast<T1*>(p2);
- d2 = get_deleter<detail::array_deleter<T2> >(s1);
- d2->construct(p2, n1, detail::sp_forward<Args>(args)...);
- return shared_ptr<T>(s1, p1);
+ d2 = get_deleter<boost::detail::array_deleter<T2> >(s1);
+ d2->construct(p2, n1, boost::detail::sp_forward<Args>(args)...);
+ return boost::shared_ptr<T>(s1, p1);
}
#endif
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
template<typename T>
- inline typename detail::sp_if_array<T>::type
- 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;
+ inline typename boost::detail::sp_if_array<T>::type
+ make_shared(std::initializer_list<typename boost::detail::array_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;
T1* p1 = 0;
T2* p2 = 0;
T3* p3 = 0;
- std::size_t n1 = list.size() * detail::array_total<T1>::size;
- detail::make_array_helper<T2> a1(n1, &p2);
- detail::array_deleter<T2> d1;
- shared_ptr<T> s1(p1, d1, a1);
- detail::array_deleter<T2>* d2;
+ std::size_t n1 = list.size() * boost::detail::array_total<T1>::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>* d2;
p3 = reinterpret_cast<T3*>(list.begin());
p1 = reinterpret_cast<T1*>(p2);
- d2 = get_deleter<detail::array_deleter<T2> >(s1);
+ d2 = get_deleter<boost::detail::array_deleter<T2> >(s1);
d2->construct_list(p2, n1, p3);
- return shared_ptr<T>(s1, p1);
+ return boost::shared_ptr<T>(s1, p1);
}
template<typename T>
- inline typename detail::sp_if_size_array<T>::type
- 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;
+ inline typename boost::detail::sp_if_size_array<T>::type
+ make_shared(std::initializer_list<typename boost::detail::array_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;
- BOOST_ASSERT(list.size() == detail::array_size<T>::size);
+ BOOST_ASSERT(list.size() == boost::detail::array_size<T>::size);
T1* p1 = 0;
T2* p2 = 0;
T3* p3 = 0;
- std::size_t n1 = detail::array_total<T>::size;
- detail::make_array_helper<T2> a1(n1, &p2);
- detail::array_deleter<T2> d1;
- shared_ptr<T> s1(p1, d1, a1);
- detail::array_deleter<T2>* d2;
+ std::size_t n1 = boost::detail::array_total<T>::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>* d2;
p3 = reinterpret_cast<T3*>(list.begin());
p1 = reinterpret_cast<T1*>(p2);
- d2 = get_deleter<detail::array_deleter<T2> >(s1);
+ d2 = get_deleter<boost::detail::array_deleter<T2> >(s1);
d2->construct_list(p2, n1, p3);
- return shared_ptr<T>(s1, p1);
+ return boost::shared_ptr<T>(s1, p1);
}
template<typename T>
- inline typename detail::sp_if_array<T>::type
+ inline typename boost::detail::sp_if_array<T>::type
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;
+ 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;
T1* p1 = 0;
T2* p2 = 0;
T3* p3 = 0;
- std::size_t n0 = detail::array_total<T1>::size;
+ std::size_t n0 = boost::detail::array_total<T1>::size;
std::size_t n1 = n0 * size;
- detail::make_array_helper<T2> a1(n1, &p2);
- detail::array_deleter<T2> d1;
- shared_ptr<T> s1(p1, d1, a1);
- detail::array_deleter<T2>* d2;
+ 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>* d2;
p3 = reinterpret_cast<T3*>(list.begin());
p1 = reinterpret_cast<T1*>(p2);
- d2 = get_deleter<detail::array_deleter<T2> >(s1);
+ d2 = get_deleter<boost::detail::array_deleter<T2> >(s1);
d2->construct_list(p2, n1, p3, n0);
- return shared_ptr<T>(s1, p1);
+ return boost::shared_ptr<T>(s1, p1);
}
template<typename T>
- inline typename detail::sp_if_size_array<T>::type
- make_shared(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;
+ inline typename boost::detail::sp_if_size_array<T>::type
+ make_shared(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;
- BOOST_ASSERT(list.size() == detail::array_size<T1>::size);
+ BOOST_ASSERT(list.size() == boost::detail::array_size<T1>::size);
T1* p1 = 0;
T2* p2 = 0;
T3* p3 = 0;
- std::size_t n0 = detail::array_total<T1>::size;
- std::size_t n1 = detail::array_total<T>::size;
- detail::make_array_helper<T2> a1(n1, &p2);
- detail::array_deleter<T2> d1;
- shared_ptr<T> s1(p1, d1, a1);
- detail::array_deleter<T2>* d2;
+ std::size_t n0 = boost::detail::array_total<T1>::size;
+ std::size_t n1 = boost::detail::array_total<T>::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>* d2;
p3 = reinterpret_cast<T3*>(list.begin());
p1 = reinterpret_cast<T1*>(p2);
- d2 = get_deleter<detail::array_deleter<T2> >(s1);
+ d2 = get_deleter<boost::detail::array_deleter<T2> >(s1);
d2->construct_list(p2, n1, p3, n0);
- return shared_ptr<T>(s1, p1);
+ return boost::shared_ptr<T>(s1, p1);
}
#endif
template<typename T>
- inline typename detail::sp_if_array<T>::type
+ inline typename boost::detail::sp_if_array<T>::type
make_shared_noinit(std::size_t size) {
- typedef typename detail::array_inner<T>::type T1;
- typedef typename detail::array_base<T1>::type T2;
+ typedef typename boost::detail::array_inner<T>::type T1;
+ typedef typename boost::detail::array_base<T1>::type T2;
T1* p1 = 0;
T2* p2 = 0;
- std::size_t n1 = size * detail::array_total<T1>::size;
- detail::make_array_helper<T2> a1(n1, &p2);
- detail::array_deleter<T2> d1;
- shared_ptr<T> s1(p1, d1, a1);
- detail::array_deleter<T2>* d2;
+ std::size_t n1 = size * boost::detail::array_total<T1>::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>* d2;
p1 = reinterpret_cast<T1*>(p2);
- d2 = get_deleter<detail::array_deleter<T2> >(s1);
+ d2 = get_deleter<boost::detail::array_deleter<T2> >(s1);
d2->construct_noinit(p2, n1);
- return shared_ptr<T>(s1, p1);
+ return boost::shared_ptr<T>(s1, p1);
}
template<typename T>
- inline typename detail::sp_if_size_array<T>::type
+ inline typename boost::detail::sp_if_size_array<T>::type
make_shared_noinit() {
- typedef typename detail::array_inner<T>::type T1;
- typedef typename detail::array_base<T1>::type T2;
+ typedef typename boost::detail::array_inner<T>::type T1;
+ typedef typename boost::detail::array_base<T1>::type T2;
T1* p1 = 0;
T2* p2 = 0;
- std::size_t n1 = detail::array_total<T>::size;
- detail::make_array_helper<T2> a1(n1, &p2);
- detail::array_deleter<T2> d1;
- shared_ptr<T> s1(p1, d1, a1);
- detail::array_deleter<T2>* d2;
+ std::size_t n1 = boost::detail::array_total<T>::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>* d2;
p1 = reinterpret_cast<T1*>(p2);
- d2 = get_deleter<detail::array_deleter<T2> >(s1);
+ d2 = get_deleter<boost::detail::array_deleter<T2> >(s1);
d2->construct_noinit(p2, n1);
- return shared_ptr<T>(s1, p1);
+ return boost::shared_ptr<T>(s1, p1);
}
}
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