forked from boostorg/smart_ptr
Cosmetic changes in make_shared and make_unique
This commit is contained in:
@@ -14,27 +14,27 @@
|
||||
#include <utility>
|
||||
|
||||
namespace boost {
|
||||
template<typename T>
|
||||
template<class T>
|
||||
inline typename boost::detail::up_if_not_array<T>::type
|
||||
make_unique() {
|
||||
return std::unique_ptr<T>(new T());
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
template<typename T, typename... Args>
|
||||
template<class T, class... Args>
|
||||
inline typename boost::detail::up_if_not_array<T>::type
|
||||
make_unique(Args&&... args) {
|
||||
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
|
||||
}
|
||||
#endif
|
||||
|
||||
template<typename T>
|
||||
template<class T>
|
||||
inline typename boost::detail::up_if_not_array<T>::type
|
||||
make_unique(T&& value) {
|
||||
return std::unique_ptr<T>(new T(std::move(value)));
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
template<class T>
|
||||
inline typename boost::detail::up_if_not_array<T>::type
|
||||
make_unique_noinit() {
|
||||
return std::unique_ptr<T>(new T);
|
||||
|
||||
Reference in New Issue
Block a user