Mark gsl::not_null swap noexcept (#1235)
Co-authored-by: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>
This commit is contained in:
1 parent
5ca9c77666
commit
9f9f65c7e2
2 files changed
+6
-2
No files matched your search
@@ -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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user