Remove uses of boost::enable_if_

This commit is contained in:
Peter Dimov committed 2024-10-06 19:16:42 +03:00
1 parent 1361171bac
commit f2abcf1654
6 files changed
+44 -43

No files matched your search

+6 -7
View File
@@ -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 <boost/type_traits/enable_if.hpp>
#include <boost/type_traits/is_array.hpp>
#include <boost/type_traits/is_unbounded_array.hpp>
#include <boost/type_traits/remove_extent.hpp>
@@ -19,35 +18,35 @@ Distributed under the Boost Software License, Version 1.0.
namespace boost {
template<class T>
inline typename enable_if_<!is_array<T>::value, std::unique_ptr<T> >::type
inline typename std::enable_if<!is_array<T>::value, std::unique_ptr<T> >::type
make_unique()
{
return std::unique_ptr<T>(new T());
}
template<class T, class... Args>
inline typename enable_if_<!is_array<T>::value, std::unique_ptr<T> >::type
inline typename std::enable_if<!is_array<T>::value, std::unique_ptr<T> >::type
make_unique(Args&&... args)
{
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
}
template<class T>
inline typename enable_if_<!is_array<T>::value, std::unique_ptr<T> >::type
inline typename std::enable_if<!is_array<T>::value, std::unique_ptr<T> >::type
make_unique(typename std::remove_reference<T>::type&& value)
{
return std::unique_ptr<T>(new T(std::move(value)));
}
template<class T>
inline typename enable_if_<!is_array<T>::value, std::unique_ptr<T> >::type
inline typename std::enable_if<!is_array<T>::value, std::unique_ptr<T> >::type
make_unique_noinit()
{
return std::unique_ptr<T>(new T);
}
template<class T>
inline typename enable_if_<is_unbounded_array<T>::value,
inline typename std::enable_if<is_unbounded_array<T>::value,
std::unique_ptr<T> >::type
make_unique(std::size_t size)
{
@@ -55,7 +54,7 @@ make_unique(std::size_t size)
}
template<class T>
inline typename enable_if_<is_unbounded_array<T>::value,
inline typename std::enable_if<is_unbounded_array<T>::value,
std::unique_ptr<T> >::type
make_unique_noinit(std::size_t size)
{