Mark gsl::not_null swap noexcept (#1235)

Co-authored-by: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>
This commit is contained in:
maflckoandMarcoFalke authored and GitHub committed 2026-03-23 12:16:36 -06:00
1 parent 5ca9c77666
commit 9f9f65c7e2
2 files changed
+6 -2

No files matched your search

+2 -2
View File
@@ -145,14 +145,14 @@ public:
not_null& operator-=(std::ptrdiff_t) = delete;
void operator[](std::ptrdiff_t) const = delete;
void swap(not_null<T>& other) { std::swap(ptr_, other.ptr_); }
void swap(not_null<T>& other) noexcept { std::swap(ptr_, other.ptr_); }
private:
T ptr_;
};
template <typename T, std::enable_if_t<std::is_move_assignable<T>::value && std::is_move_constructible<T>::value, bool> = true>
void swap(not_null<T>& a, not_null<T>& b)
void swap(not_null<T>& a, not_null<T>& b) noexcept
{
a.swap(b);
}