Skip to content

Commit

Permalink
Remove uses of boost::is_bounded_array
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimov committed Oct 6, 2024
1 parent 7f880bc commit b12e342
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 17 deletions.
7 changes: 4 additions & 3 deletions include/boost/smart_ptr/allocate_local_shared_array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Distributed under the Boost Software License, Version 1.0.

#include <boost/smart_ptr/allocate_shared_array.hpp>
#include <boost/smart_ptr/local_shared_ptr.hpp>
#include <boost/smart_ptr/detail/sp_type_traits.hpp>
#include <type_traits>

namespace boost {
Expand Down Expand Up @@ -90,7 +91,7 @@ allocate_local_shared(const A& allocator, std::size_t count)
}

template<class T, class A>
inline typename std::enable_if<is_bounded_array<T>::value,
inline typename std::enable_if<detail::sp_is_bounded_array<T>::value,
local_shared_ptr<T> >::type
allocate_local_shared(const A& allocator)
{
Expand Down Expand Up @@ -134,7 +135,7 @@ allocate_local_shared(const A& allocator, std::size_t count,
}

template<class T, class A>
inline typename std::enable_if<is_bounded_array<T>::value,
inline typename std::enable_if<detail::sp_is_bounded_array<T>::value,
local_shared_ptr<T> >::type
allocate_local_shared(const A& allocator,
const typename std::remove_extent<T>::type& value)
Expand Down Expand Up @@ -167,7 +168,7 @@ allocate_local_shared_noinit(const A& allocator, std::size_t count)
}

template<class T, class A>
inline typename std::enable_if<is_bounded_array<T>::value,
inline typename std::enable_if<detail::sp_is_bounded_array<T>::value,
local_shared_ptr<T> >::type
allocate_local_shared_noinit(const A& allocator)
{
Expand Down
8 changes: 4 additions & 4 deletions include/boost/smart_ptr/allocate_shared_array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ 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/is_bounded_array.hpp>
#include <boost/smart_ptr/detail/sp_type_traits.hpp>
#include <boost/type_traits/is_unbounded_array.hpp>
#include <boost/type_traits/type_with_alignment.hpp>
#include <type_traits>
Expand Down Expand Up @@ -271,7 +271,7 @@ allocate_shared(const A& allocator, std::size_t count)
}

template<class T, class A>
inline typename std::enable_if<is_bounded_array<T>::value, shared_ptr<T> >::type
inline typename std::enable_if<detail::sp_is_bounded_array<T>::value, shared_ptr<T> >::type
allocate_shared(const A& allocator)
{
enum {
Expand Down Expand Up @@ -309,7 +309,7 @@ allocate_shared(const A& allocator, std::size_t count,
}

template<class T, class A>
inline typename std::enable_if<is_bounded_array<T>::value, shared_ptr<T> >::type
inline typename std::enable_if<detail::sp_is_bounded_array<T>::value, shared_ptr<T> >::type
allocate_shared(const A& allocator,
const typename std::remove_extent<T>::type& value)
{
Expand Down Expand Up @@ -337,7 +337,7 @@ allocate_shared_noinit(const A& allocator, std::size_t count)
}

template<class T, class A>
inline typename std::enable_if<is_bounded_array<T>::value, shared_ptr<T> >::type
inline typename std::enable_if<detail::sp_is_bounded_array<T>::value, shared_ptr<T> >::type
allocate_shared_noinit(const A& allocator)
{
return boost::allocate_shared<T>(boost::noinit_adapt(allocator));
Expand Down
8 changes: 4 additions & 4 deletions include/boost/smart_ptr/allocate_unique.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ 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/is_bounded_array.hpp>
#include <boost/smart_ptr/detail/sp_type_traits.hpp>
#include <boost/type_traits/is_unbounded_array.hpp>
#include <boost/type_traits/type_identity.hpp>
#include <boost/config.hpp>
Expand Down Expand Up @@ -399,7 +399,7 @@ allocate_unique(const A& alloc, std::size_t size)
}

template<class T, class A>
inline typename std::enable_if<is_bounded_array<T>::value,
inline typename std::enable_if<detail::sp_is_bounded_array<T>::value,
std::unique_ptr<typename detail::sp_alloc_result<T>::type,
alloc_deleter<T, A> > >::type
allocate_unique(const A& alloc)
Expand All @@ -419,7 +419,7 @@ allocate_unique_noinit(const A& alloc, std::size_t size)
}

template<class T, class A>
inline typename std::enable_if<is_bounded_array<T>::value,
inline typename std::enable_if<detail::sp_is_bounded_array<T>::value,
std::unique_ptr<typename detail::sp_alloc_result<T>::type,
alloc_deleter<T, noinit_adaptor<A> > > >::type
allocate_unique_noinit(const A& alloc)
Expand All @@ -441,7 +441,7 @@ allocate_unique(const A& alloc, std::size_t size,
}

template<class T, class A>
inline typename std::enable_if<is_bounded_array<T>::value,
inline typename std::enable_if<detail::sp_is_bounded_array<T>::value,
std::unique_ptr<typename detail::sp_alloc_result<T>::type,
alloc_deleter<T, A> > >::type
allocate_unique(const A& alloc,
Expand Down
7 changes: 4 additions & 3 deletions include/boost/smart_ptr/make_local_shared_array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ Distributed under the Boost Software License, Version 1.0.

#include <boost/core/default_allocator.hpp>
#include <boost/smart_ptr/allocate_local_shared_array.hpp>
#include <boost/smart_ptr/detail/sp_type_traits.hpp>
#include <type_traits>

namespace boost {

template<class T>
inline typename std::enable_if<is_bounded_array<T>::value,
inline typename std::enable_if<detail::sp_is_bounded_array<T>::value,
local_shared_ptr<T> >::type
make_local_shared()
{
Expand All @@ -25,7 +26,7 @@ make_local_shared()
}

template<class T>
inline typename std::enable_if<is_bounded_array<T>::value,
inline typename std::enable_if<detail::sp_is_bounded_array<T>::value,
local_shared_ptr<T> >::type
make_local_shared(const typename std::remove_extent<T>::type& value)
{
Expand Down Expand Up @@ -53,7 +54,7 @@ make_local_shared(std::size_t size,
}

template<class T>
inline typename std::enable_if<is_bounded_array<T>::value,
inline typename std::enable_if<detail::sp_is_bounded_array<T>::value,
local_shared_ptr<T> >::type
make_local_shared_noinit()
{
Expand Down
7 changes: 4 additions & 3 deletions include/boost/smart_ptr/make_shared_array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,21 @@ Distributed under the Boost Software License, Version 1.0.

#include <boost/core/default_allocator.hpp>
#include <boost/smart_ptr/allocate_shared_array.hpp>
#include <boost/smart_ptr/detail/sp_type_traits.hpp>
#include <type_traits>

namespace boost {

template<class T>
inline typename std::enable_if<is_bounded_array<T>::value, shared_ptr<T> >::type
inline typename std::enable_if<detail::sp_is_bounded_array<T>::value, shared_ptr<T> >::type
make_shared()
{
return boost::allocate_shared<T>(boost::default_allocator<typename
detail::sp_array_element<T>::type>());
}

template<class T>
inline typename std::enable_if<is_bounded_array<T>::value, shared_ptr<T> >::type
inline typename std::enable_if<detail::sp_is_bounded_array<T>::value, shared_ptr<T> >::type
make_shared(const typename std::remove_extent<T>::type& value)
{
return boost::allocate_shared<T>(boost::default_allocator<typename
Expand All @@ -47,7 +48,7 @@ make_shared(std::size_t size, const typename std::remove_extent<T>::type& value)
}

template<class T>
inline typename std::enable_if<is_bounded_array<T>::value, shared_ptr<T> >::type
inline typename std::enable_if<detail::sp_is_bounded_array<T>::value, shared_ptr<T> >::type
make_shared_noinit()
{
return boost::allocate_shared_noinit<T>(boost::default_allocator<typename
Expand Down

0 comments on commit b12e342

Please sign in to comment.