diff --git a/include/gsl/pointers b/include/gsl/pointers index 5e49f5f..0ec0fc3 100644 --- a/include/gsl/pointers +++ b/include/gsl/pointers @@ -113,7 +113,7 @@ private: }; template -auto make_not_null(T&& t) { +auto make_not_null(T&& t) noexcept { return not_null>>{std::forward(t)}; } @@ -125,37 +125,37 @@ std::ostream& operator<<(std::ostream& os, const not_null& val) } template -auto operator==(const not_null& lhs, const not_null& rhs) -> decltype(lhs.get() == rhs.get()) +auto operator==(const not_null& lhs, const not_null& rhs) noexcept(noexcept(lhs.get() == rhs.get())) -> decltype(lhs.get() == rhs.get()) { return lhs.get() == rhs.get(); } template -auto operator!=(const not_null& lhs, const not_null& rhs) -> decltype(lhs.get() != rhs.get()) +auto operator!=(const not_null& lhs, const not_null& rhs) noexcept(noexcept(lhs.get() != rhs.get())) -> decltype(lhs.get() != rhs.get()) { return lhs.get() != rhs.get(); } template -auto operator<(const not_null& lhs, const not_null& rhs) -> decltype(lhs.get() < rhs.get()) +auto operator<(const not_null& lhs, const not_null& rhs) noexcept(noexcept(lhs.get() < rhs.get())) -> decltype(lhs.get() < rhs.get()) { return lhs.get() < rhs.get(); } template -auto operator<=(const not_null& lhs, const not_null& rhs) -> decltype(lhs.get() <= rhs.get()) +auto operator<=(const not_null& lhs, const not_null& rhs) noexcept(noexcept(lhs.get() <= rhs.get())) -> decltype(lhs.get() <= rhs.get()) { return lhs.get() <= rhs.get(); } template -auto operator>(const not_null& lhs, const not_null& rhs) -> decltype(lhs.get() > rhs.get()) +auto operator>(const not_null& lhs, const not_null& rhs) noexcept(noexcept(lhs.get() > rhs.get())) -> decltype(lhs.get() > rhs.get()) { return lhs.get() > rhs.get(); } template -auto operator>=(const not_null& lhs, const not_null& rhs) -> decltype(lhs.get() >= rhs.get()) +auto operator>=(const not_null& lhs, const not_null& rhs) noexcept(noexcept(lhs.get() >= rhs.get())) -> decltype(lhs.get() >= rhs.get()) { return lhs.get() >= rhs.get(); } @@ -261,7 +261,7 @@ template strict_not_null operator+(std::ptrdiff_t, const strict_not_null&) = delete; template -auto make_strict_not_null(T&& t) { +auto make_strict_not_null(T&& t) noexcept { return strict_not_null>>{std::forward(t)}; }