From 0bedddbf16982f8f3e624bcc9e2416ab2537948d Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 6 Oct 2024 19:35:07 +0300 Subject: [PATCH] Remove uses of boost::is_array --- include/boost/smart_ptr/allocate_unique.hpp | 15 +++++++-------- include/boost/smart_ptr/make_unique.hpp | 9 ++++----- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/include/boost/smart_ptr/allocate_unique.hpp b/include/boost/smart_ptr/allocate_unique.hpp index 02d4d50..560a3a1 100644 --- a/include/boost/smart_ptr/allocate_unique.hpp +++ b/include/boost/smart_ptr/allocate_unique.hpp @@ -14,7 +14,6 @@ Distributed under the Boost Software License, Version 1.0. #include #include #include -#include #include #include #include @@ -256,7 +255,7 @@ operator!=(std::nullptr_t, template inline void sp_alloc_clear(A& a, typename boost::allocator_pointer::type p, std::size_t, - boost::false_type) + std::false_type) { boost::alloc_destroy(a, boost::to_address(p)); } @@ -264,7 +263,7 @@ sp_alloc_clear(A& a, typename boost::allocator_pointer::type p, std::size_t, template inline void sp_alloc_clear(A& a, typename boost::allocator_pointer::type p, - std::size_t n, boost::true_type) + std::size_t n, std::true_type) { #if defined(BOOST_MSVC) && BOOST_MSVC < 1800 if (!p) { @@ -293,7 +292,7 @@ public: : base(empty_init_t(), a) { } void operator()(pointer p) { - detail::sp_alloc_clear(base::get(), p.ptr(), p.size(), is_array()); + detail::sp_alloc_clear(base::get(), p.ptr(), p.size(), std::is_array()); base::get().deallocate(p.ptr(), p.size()); } }; @@ -351,7 +350,7 @@ private: } /* detail */ template -inline typename std::enable_if::value, +inline typename std::enable_if::value, std::unique_ptr > >::type allocate_unique(const A& alloc) { @@ -361,7 +360,7 @@ allocate_unique(const A& alloc) } template -inline typename std::enable_if::value, +inline typename std::enable_if::value, std::unique_ptr > >::type allocate_unique(const A& alloc, Args&&... args) { @@ -371,7 +370,7 @@ allocate_unique(const A& alloc, Args&&... args) } template -inline typename std::enable_if::value, +inline typename std::enable_if::value, std::unique_ptr > >::type allocate_unique(const A& alloc, typename type_identity::type&& value) { @@ -381,7 +380,7 @@ allocate_unique(const A& alloc, typename type_identity::type&& value) } template -inline typename std::enable_if::value, +inline typename std::enable_if::value, std::unique_ptr > > >::type allocate_unique_noinit(const A& alloc) { diff --git a/include/boost/smart_ptr/make_unique.hpp b/include/boost/smart_ptr/make_unique.hpp index 0fb485c..e32b2c9 100644 --- a/include/boost/smart_ptr/make_unique.hpp +++ b/include/boost/smart_ptr/make_unique.hpp @@ -8,7 +8,6 @@ Distributed under the Boost Software License, Version 1.0. #ifndef BOOST_SMART_PTR_MAKE_UNIQUE_HPP #define BOOST_SMART_PTR_MAKE_UNIQUE_HPP -#include #include #include #include @@ -17,28 +16,28 @@ Distributed under the Boost Software License, Version 1.0. namespace boost { template -inline typename std::enable_if::value, std::unique_ptr >::type +inline typename std::enable_if::value, std::unique_ptr >::type make_unique() { return std::unique_ptr(new T()); } template -inline typename std::enable_if::value, std::unique_ptr >::type +inline typename std::enable_if::value, std::unique_ptr >::type make_unique(Args&&... args) { return std::unique_ptr(new T(std::forward(args)...)); } template -inline typename std::enable_if::value, std::unique_ptr >::type +inline typename std::enable_if::value, std::unique_ptr >::type make_unique(typename std::remove_reference::type&& value) { return std::unique_ptr(new T(std::move(value))); } template -inline typename std::enable_if::value, std::unique_ptr >::type +inline typename std::enable_if::value, std::unique_ptr >::type make_unique_noinit() { return std::unique_ptr(new T);