mirror of
https://github.com/boostorg/smart_ptr.git
synced 2025-08-02 14:14:27 +02:00
Remove uses of boost::extent
This commit is contained in:
@@ -95,7 +95,7 @@ inline typename std::enable_if<is_bounded_array<T>::value,
|
|||||||
allocate_local_shared(const A& allocator)
|
allocate_local_shared(const A& allocator)
|
||||||
{
|
{
|
||||||
enum {
|
enum {
|
||||||
count = extent<T>::value
|
count = std::extent<T>::value
|
||||||
};
|
};
|
||||||
typedef typename detail::sp_array_element<T>::type element;
|
typedef typename detail::sp_array_element<T>::type element;
|
||||||
typedef typename allocator_rebind<A, element>::type other;
|
typedef typename allocator_rebind<A, element>::type other;
|
||||||
@@ -140,7 +140,7 @@ allocate_local_shared(const A& allocator,
|
|||||||
const typename remove_extent<T>::type& value)
|
const typename remove_extent<T>::type& value)
|
||||||
{
|
{
|
||||||
enum {
|
enum {
|
||||||
count = extent<T>::value
|
count = std::extent<T>::value
|
||||||
};
|
};
|
||||||
typedef typename detail::sp_array_element<T>::type element;
|
typedef typename detail::sp_array_element<T>::type element;
|
||||||
typedef typename allocator_rebind<A, element>::type other;
|
typedef typename allocator_rebind<A, element>::type other;
|
||||||
|
@@ -12,7 +12,6 @@ Distributed under the Boost Software License, Version 1.0.
|
|||||||
#include <boost/core/alloc_construct.hpp>
|
#include <boost/core/alloc_construct.hpp>
|
||||||
#include <boost/core/first_scalar.hpp>
|
#include <boost/core/first_scalar.hpp>
|
||||||
#include <boost/smart_ptr/shared_ptr.hpp>
|
#include <boost/smart_ptr/shared_ptr.hpp>
|
||||||
#include <boost/type_traits/extent.hpp>
|
|
||||||
#include <boost/type_traits/is_bounded_array.hpp>
|
#include <boost/type_traits/is_bounded_array.hpp>
|
||||||
#include <boost/type_traits/is_unbounded_array.hpp>
|
#include <boost/type_traits/is_unbounded_array.hpp>
|
||||||
#include <boost/type_traits/remove_cv.hpp>
|
#include <boost/type_traits/remove_cv.hpp>
|
||||||
@@ -278,11 +277,11 @@ inline typename std::enable_if<is_bounded_array<T>::value, shared_ptr<T> >::type
|
|||||||
allocate_shared(const A& allocator)
|
allocate_shared(const A& allocator)
|
||||||
{
|
{
|
||||||
enum {
|
enum {
|
||||||
count = extent<T>::value
|
count = std::extent<T>::value
|
||||||
};
|
};
|
||||||
typedef typename detail::sp_array_element<T>::type element;
|
typedef typename detail::sp_array_element<T>::type element;
|
||||||
typedef typename allocator_rebind<A, element>::type other;
|
typedef typename allocator_rebind<A, element>::type other;
|
||||||
typedef detail::sp_size_array_state<other, extent<T>::value> state;
|
typedef detail::sp_size_array_state<other, std::extent<T>::value> state;
|
||||||
typedef detail::sp_array_base<state> base;
|
typedef detail::sp_array_base<state> base;
|
||||||
detail::sp_array_result<other, base> result(allocator, count);
|
detail::sp_array_result<other, base> result(allocator, count);
|
||||||
base* node = result.get();
|
base* node = result.get();
|
||||||
@@ -317,11 +316,11 @@ allocate_shared(const A& allocator,
|
|||||||
const typename remove_extent<T>::type& value)
|
const typename remove_extent<T>::type& value)
|
||||||
{
|
{
|
||||||
enum {
|
enum {
|
||||||
count = extent<T>::value
|
count = std::extent<T>::value
|
||||||
};
|
};
|
||||||
typedef typename detail::sp_array_element<T>::type element;
|
typedef typename detail::sp_array_element<T>::type element;
|
||||||
typedef typename allocator_rebind<A, element>::type other;
|
typedef typename allocator_rebind<A, element>::type other;
|
||||||
typedef detail::sp_size_array_state<other, extent<T>::value> state;
|
typedef detail::sp_size_array_state<other, std::extent<T>::value> state;
|
||||||
typedef detail::sp_array_base<state> base;
|
typedef detail::sp_array_base<state> base;
|
||||||
detail::sp_array_result<other, base> result(allocator, count);
|
detail::sp_array_result<other, base> result(allocator, count);
|
||||||
base* node = result.get();
|
base* node = result.get();
|
||||||
|
@@ -14,7 +14,6 @@ Distributed under the Boost Software License, Version 1.0.
|
|||||||
#include <boost/core/first_scalar.hpp>
|
#include <boost/core/first_scalar.hpp>
|
||||||
#include <boost/core/noinit_adaptor.hpp>
|
#include <boost/core/noinit_adaptor.hpp>
|
||||||
#include <boost/core/pointer_traits.hpp>
|
#include <boost/core/pointer_traits.hpp>
|
||||||
#include <boost/type_traits/extent.hpp>
|
|
||||||
#include <boost/type_traits/is_array.hpp>
|
#include <boost/type_traits/is_array.hpp>
|
||||||
#include <boost/type_traits/is_bounded_array.hpp>
|
#include <boost/type_traits/is_bounded_array.hpp>
|
||||||
#include <boost/type_traits/is_unbounded_array.hpp>
|
#include <boost/type_traits/is_unbounded_array.hpp>
|
||||||
@@ -408,7 +407,7 @@ inline typename std::enable_if<is_bounded_array<T>::value,
|
|||||||
alloc_deleter<T, A> > >::type
|
alloc_deleter<T, A> > >::type
|
||||||
allocate_unique(const A& alloc)
|
allocate_unique(const A& alloc)
|
||||||
{
|
{
|
||||||
detail::sp_alloc_make<T, A> c(alloc, extent<T>::value);
|
detail::sp_alloc_make<T, A> c(alloc, std::extent<T>::value);
|
||||||
boost::alloc_construct_n(c.state(), boost::first_scalar(c.get()),
|
boost::alloc_construct_n(c.state(), boost::first_scalar(c.get()),
|
||||||
detail::sp_alloc_size<T>::value);
|
detail::sp_alloc_size<T>::value);
|
||||||
return c.release();
|
return c.release();
|
||||||
@@ -451,7 +450,7 @@ inline typename std::enable_if<is_bounded_array<T>::value,
|
|||||||
allocate_unique(const A& alloc,
|
allocate_unique(const A& alloc,
|
||||||
const typename remove_extent<T>::type& value)
|
const typename remove_extent<T>::type& value)
|
||||||
{
|
{
|
||||||
detail::sp_alloc_make<T, A> c(alloc, extent<T>::value);
|
detail::sp_alloc_make<T, A> c(alloc, std::extent<T>::value);
|
||||||
boost::alloc_construct_n(c.state(), boost::first_scalar(c.get()),
|
boost::alloc_construct_n(c.state(), boost::first_scalar(c.get()),
|
||||||
detail::sp_alloc_size<T>::value, boost::first_scalar(&value),
|
detail::sp_alloc_size<T>::value, boost::first_scalar(&value),
|
||||||
detail::sp_alloc_size<typename remove_extent<T>::type>::value);
|
detail::sp_alloc_size<typename remove_extent<T>::type>::value);
|
||||||
|
Reference in New Issue
Block a user