String: Make swap method noexcept

There is no reason why it should not be `noexcept`.
`std::swap` cannot have any exceptions or handle any.
This commit is contained in:
Rose
2024-08-19 13:00:47 -04:00
committed by Brad King
parent 8fae37d99f
commit 873b8244f0

View File

@@ -518,7 +518,7 @@ public:
*this = std::move(s);
}
void swap(String& other)
void swap(String& other) noexcept
{
std::swap(this->string_, other.string_);
std::swap(this->view_, other.view_);