|
|
@@ -32,18 +32,18 @@ public:
|
|
|
explicit not_null(int) = delete;
|
|
|
not_null(T const & p) : _ptr(p) { validate(); }
|
|
|
not_null(T && p) : _ptr(std::move(p)) { validate(); }
|
|
|
- not_null(not_null const&) noexcept(std::is_nothrow_copy_constructible<Y>::value) = default;
|
|
|
+ not_null(not_null const&) noexcept(std::is_nothrow_copy_constructible<T>::value) = default;
|
|
|
|
|
|
template <typename Y>
|
|
|
- explicit operator maybe_null<Y>() const noexcept(std::is_nothrow_copy_constructible<Y>::value) {
|
|
|
+ explicit operator maybe_null<Y>() const noexcept(std::is_nothrow_constructible<Y, T>::value) {
|
|
|
return _ptr;
|
|
|
}
|
|
|
template <typename Y>
|
|
|
- explicit operator not_null<Y>() const noexcept(std::is_nothrow_copy_constructible<Y>::value) {
|
|
|
+ explicit operator not_null<Y>() const noexcept(std::is_nothrow_constructible<Y, T>::value) {
|
|
|
return _ptr;
|
|
|
}
|
|
|
|
|
|
- not_null& operator=(not_null const&) noexcept(std::is_nothrow_copy_constructible<Y>::value) = default;
|
|
|
+ not_null& operator=(not_null const&) noexcept(std::is_nothrow_copy_constructible<T>::value) = default;
|
|
|
template <typename Y> not_null& operator=(not_null<Y> const&other) noexcept(std::is_nothrow_copy_constructible<T>::value) {
|
|
|
_ptr = other._ptr;
|
|
|
return *this;
|