diff --git a/include/enum_name.hpp b/include/enum_name.hpp index 7be2bfb..da9e93f 100644 --- a/include/enum_name.hpp +++ b/include/enum_name.hpp @@ -174,6 +174,24 @@ class basic_string_view { return (lhs.size_ == rhs.size_) && std::strncmp(lhs.data_, rhs.data_, lhs.size_) == 0; } + constexpr friend inline bool + operator==(basic_string_view lhs, const Char* rhs) noexcept + { + return (lhs.size_ == strlen_constexpr(rhs)) && std::strncmp(lhs.data_, rhs, lhs.size_) == 0; + } + + constexpr friend inline bool + operator!=(basic_string_view lhs, basic_string_view rhs) noexcept + { + return !(lhs == rhs); + } + + constexpr friend inline bool + operator!=(basic_string_view lhs, const Char* rhs) noexcept + { + return !(lhs == rhs); + } + inline operator std::string() { return std::string(data_, size_);