forked from boostorg/smart_ptr
Bind allocator to element type, not scalar type
This commit is contained in:
@@ -18,7 +18,7 @@ inline typename enable_if_<is_bounded_array<T>::value, shared_ptr<T> >::type
|
||||
make_shared()
|
||||
{
|
||||
return boost::allocate_shared<T>(boost::default_allocator<typename
|
||||
detail::sp_array_scalar<T>::type>());
|
||||
detail::sp_array_element<T>::type>());
|
||||
}
|
||||
|
||||
template<class T>
|
||||
@@ -26,7 +26,7 @@ inline typename enable_if_<is_bounded_array<T>::value, shared_ptr<T> >::type
|
||||
make_shared(const typename remove_extent<T>::type& value)
|
||||
{
|
||||
return boost::allocate_shared<T>(boost::default_allocator<typename
|
||||
detail::sp_array_scalar<T>::type>(), value);
|
||||
detail::sp_array_element<T>::type>(), value);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
@@ -34,7 +34,7 @@ inline typename enable_if_<is_unbounded_array<T>::value, shared_ptr<T> >::type
|
||||
make_shared(std::size_t size)
|
||||
{
|
||||
return boost::allocate_shared<T>(boost::default_allocator<typename
|
||||
detail::sp_array_scalar<T>::type>(), size);
|
||||
detail::sp_array_element<T>::type>(), size);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
@@ -42,7 +42,7 @@ inline typename enable_if_<is_unbounded_array<T>::value, shared_ptr<T> >::type
|
||||
make_shared(std::size_t size, const typename remove_extent<T>::type& value)
|
||||
{
|
||||
return boost::allocate_shared<T>(boost::default_allocator<typename
|
||||
detail::sp_array_scalar<T>::type>(), size, value);
|
||||
detail::sp_array_element<T>::type>(), size, value);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
@@ -50,7 +50,7 @@ inline typename enable_if_<is_bounded_array<T>::value, shared_ptr<T> >::type
|
||||
make_shared_noinit()
|
||||
{
|
||||
return boost::allocate_shared_noinit<T>(boost::default_allocator<typename
|
||||
detail::sp_array_scalar<T>::type>());
|
||||
detail::sp_array_element<T>::type>());
|
||||
}
|
||||
|
||||
template<class T>
|
||||
@@ -58,7 +58,7 @@ inline typename enable_if_<is_unbounded_array<T>::value, shared_ptr<T> >::type
|
||||
make_shared_noinit(std::size_t size)
|
||||
{
|
||||
return boost::allocate_shared_noinit<T>(boost::default_allocator<typename
|
||||
detail::sp_array_scalar<T>::type>(), size);
|
||||
detail::sp_array_element<T>::type>(), size);
|
||||
}
|
||||
|
||||
} /* boost */
|
||||
|
||||
Reference in New Issue
Block a user