Browse Source

Fixing noexcept to not have type/syntax error

Samuel Jaffe 8 years ago
parent
commit
d834f7ba93
1 changed files with 4 additions and 4 deletions
  1. 4 4
      not_null.hpp

+ 4 - 4
not_null.hpp

@@ -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;