Document StringViewLiteral equality members
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2022-03-23 14:20:20 +01:00
parent a618f2b98b
commit 47272b0206
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 4 additions and 0 deletions

View File

@ -32,13 +32,17 @@ namespace ArbUt {
/// @return A normal StringView.
inline operator StringView() const noexcept { return StringView(*this, _str, _length); }
/// @brief Check equality with standard C++ string.
inline constexpr bool operator==(const std::string_view& rhs) const noexcept final {
return _hash == Hash(rhs.data());
}
/// @brief Check inequality with standard C++ string.
inline constexpr bool operator!=(const std::string_view& rhs) const noexcept final {
return _hash != Hash(rhs.data());
}
/// @brief Check equality with standard C style string.
inline constexpr bool operator==(const char* non_null rhs) const noexcept final { return _hash == Hash(rhs); }
/// @brief Check inequality with standard C style string.
inline constexpr bool operator!=(const char* non_null rhs) const noexcept final { return _hash != Hash(rhs); }
};
}