|
|
@@ -27,8 +27,12 @@ public:
|
|
|
explicit not_null(int) = delete;
|
|
|
not_null(P const & p) : _ptr(p) { validate(); }
|
|
|
not_null(P && p) : _ptr(std::move(p)) { validate(); }
|
|
|
+ template <typename Y, typename = typename std::enable_if<std::is_constructible<P, Y>::value>::type>
|
|
|
+ not_null(Y const & p) : _ptr(p) { validate(); }
|
|
|
+ template <typename Y, typename = typename std::enable_if<std::is_constructible<P, Y>::value>::type>
|
|
|
+ not_null(Y && p) : _ptr(std::move(p)) { validate(); }
|
|
|
not_null(not_null const&) noexcept(detail::is_nt_cc<P>::value) = default;
|
|
|
- not_null(not_null &&) = delete;
|
|
|
+// not_null(not_null &&) = delete;
|
|
|
|
|
|
template <typename Y>
|
|
|
explicit operator maybe_null<Y>() const noexcept(detail::is_nt_c<Y, P>::value) {
|
|
|
@@ -40,7 +44,7 @@ public:
|
|
|
}
|
|
|
|
|
|
not_null& operator=(not_null const&) noexcept(detail::is_nt_ca<P>::value) = default;
|
|
|
- not_null& operator=(not_null &&) = delete;
|
|
|
+// not_null& operator=(not_null &&) = delete;
|
|
|
|
|
|
operator bool() const noexcept { return true; }
|
|
|
|