Skip to content

Commit

Permalink
Remove uses of boost::extent
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimov committed Oct 6, 2024
1 parent 7c87ae7 commit 9b30918
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions include/boost/smart_ptr/allocate_local_shared_array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ inline typename std::enable_if<is_bounded_array<T>::value,
allocate_local_shared(const A& allocator)
{
enum {
count = extent<T>::value
count = std::extent<T>::value
};
typedef typename detail::sp_array_element<T>::type element;
typedef typename allocator_rebind<A, element>::type other;
Expand Down Expand Up @@ -140,7 +140,7 @@ allocate_local_shared(const A& allocator,
const typename remove_extent<T>::type& value)
{
enum {
count = extent<T>::value
count = std::extent<T>::value
};
typedef typename detail::sp_array_element<T>::type element;
typedef typename allocator_rebind<A, element>::type other;
Expand Down
9 changes: 4 additions & 5 deletions include/boost/smart_ptr/allocate_shared_array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Distributed under the Boost Software License, Version 1.0.
#include <boost/core/alloc_construct.hpp>
#include <boost/core/first_scalar.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_unbounded_array.hpp>
#include <boost/type_traits/remove_cv.hpp>
Expand Down Expand Up @@ -278,11 +277,11 @@ inline typename std::enable_if<is_bounded_array<T>::value, shared_ptr<T> >::type
allocate_shared(const A& allocator)
{
enum {
count = extent<T>::value
count = std::extent<T>::value
};
typedef typename detail::sp_array_element<T>::type element;
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;
detail::sp_array_result<other, base> result(allocator, count);
base* node = result.get();
Expand Down Expand Up @@ -317,11 +316,11 @@ allocate_shared(const A& allocator,
const typename remove_extent<T>::type& value)
{
enum {
count = extent<T>::value
count = std::extent<T>::value
};
typedef typename detail::sp_array_element<T>::type element;
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;
detail::sp_array_result<other, base> result(allocator, count);
base* node = result.get();
Expand Down
5 changes: 2 additions & 3 deletions include/boost/smart_ptr/allocate_unique.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Distributed under the Boost Software License, Version 1.0.
#include <boost/core/first_scalar.hpp>
#include <boost/core/noinit_adaptor.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_bounded_array.hpp>
#include <boost/type_traits/is_unbounded_array.hpp>
Expand Down Expand Up @@ -408,7 +407,7 @@ inline typename std::enable_if<is_bounded_array<T>::value,
alloc_deleter<T, A> > >::type
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()),
detail::sp_alloc_size<T>::value);
return c.release();
Expand Down Expand Up @@ -451,7 +450,7 @@ inline typename std::enable_if<is_bounded_array<T>::value,
allocate_unique(const A& alloc,
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()),
detail::sp_alloc_size<T>::value, boost::first_scalar(&value),
detail::sp_alloc_size<typename remove_extent<T>::type>::value);
Expand Down

0 comments on commit 9b30918

Please sign in to comment.