| { | { | ||||
| public: | public: | ||||
| template<class TT, class G, std::enable_if_t<std::is_constructible<T, TT>::value, int> = 0> | |||||
| template<class TT, class G, std::enable_if_t<std::is_constructible_v<T, TT>, int> = 0> | |||||
| explicit Wrapper(TT&& value, G&& g) noexcept(noexcept(Wrapper{value})) : Wrapper(value) | explicit Wrapper(TT&& value, G&& g) noexcept(noexcept(Wrapper{value})) : Wrapper(value) | ||||
| { | { | ||||
| g.release(); | g.release(); | ||||
| return m_value; | return m_value; | ||||
| } | } | ||||
| void reset(T&& newValue) noexcept(std::is_nothrow_assignable<T, decltype(std::move_if_noexcept(newValue))>::value) | |||||
| void reset(T&& newValue) noexcept(std::is_nothrow_assignable_v<T, decltype(std::move_if_noexcept(newValue))>) | |||||
| { | { | ||||
| m_value = std::move_if_noexcept(newValue); | m_value = std::move_if_noexcept(newValue); | ||||
| } | } | ||||
| void reset(const T& newValue) noexcept(std::is_nothrow_assignable<T, const T&>::value) | |||||
| void reset(const T& newValue) noexcept(std::is_nothrow_assignable_v<T, const T&>) | |||||
| { | { | ||||
| m_value = newValue; | m_value = newValue; | ||||
| } | } | ||||
| { | { | ||||
| public: | public: | ||||
| template<class TT, class G, std::enable_if_t<std::is_convertible<TT, T&>::value, int> = 0> | |||||
| template<class TT, class G, std::enable_if_t<std::is_convertible_v<TT, T&>, int> = 0> | |||||
| explicit Wrapper(TT&& value, G&& g) noexcept(noexcept(static_cast<T&>(value))) : m_value(static_cast<T&>(value)) | explicit Wrapper(TT&& value, G&& g) noexcept(noexcept(static_cast<T&>(value))) : m_value(static_cast<T&>(value)) | ||||
| { | { | ||||
| g.release(); | g.release(); |