|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
template<class T, std::enable_if_t<!std::is_nothrow_move_constructible<T>::value, int> = 0> |
|
|
template<class T, std::enable_if_t<!std::is_nothrow_move_constructible<T>::value, int> = 0> |
|
|
constexpr T forward_if_nothrow_move_constructible(T&& value) |
|
|
|
|
|
|
|
|
constexpr const T& forward_if_nothrow_move_constructible(T&& value) |
|
|
{ |
|
|
{ |
|
|
return value; |
|
|
return value; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
std::enable_if_t<is_nothrow_move_or_copy_constructible_from_v<R, RR>, int> = 0, |
|
|
std::enable_if_t<is_nothrow_move_or_copy_constructible_from_v<R, RR>, int> = 0, |
|
|
std::enable_if_t<is_nothrow_move_or_copy_constructible_from_v<D, DD>, int> = 0 |
|
|
std::enable_if_t<is_nothrow_move_or_copy_constructible_from_v<D, DD>, int> = 0 |
|
|
> |
|
|
> |
|
|
explicit unique_resource(RR&& r, DD&& d) noexcept(std::is_nothrow_constructible<R, RR>::value |
|
|
|
|
|
|
|
|
explicit unique_resource(RR&& r, DD&& d) noexcept(std::is_nothrow_constructible<R,RR>::value |
|
|
&& std::is_nothrow_constructible<D, DD>::value) |
|
|
&& std::is_nothrow_constructible<D, DD>::value) |
|
|
: m_resource(std::move(r)), |
|
|
: m_resource(std::move(r)), |
|
|
m_deleter(std::move(d)), |
|
|
m_deleter(std::move(d)), |