Implements .Empty method on constString types.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
e9d36a6237
commit
4c36946496
|
@ -32,6 +32,7 @@
|
|||
[[nodiscard]] inline constexpr size_t Length() const noexcept { return _length; } \
|
||||
\
|
||||
[[nodiscard]] inline constexpr uint32_t GetHash() const noexcept { return _hash; } \
|
||||
inline constexpr bool Empty() const noexcept { return _length == 0; } \
|
||||
\
|
||||
constexpr std::size_t operator()(name const& s) const noexcept { return s.GetHash(); } \
|
||||
inline constexpr operator uint32_t() const { return _hash; } \
|
||||
|
@ -39,9 +40,11 @@
|
|||
inline constexpr bool operator==(const name& rhs) const { return _hash == rhs._hash; } \
|
||||
inline constexpr bool operator!=(const name& rhs) const { return _hash != rhs._hash; } \
|
||||
inline STDSTRINGCONSTEXPR bool operator==(const std::string& rhs) const { \
|
||||
return _hash == Hash(rhs.c_str()); } \
|
||||
return _hash == Hash(rhs.c_str()); \
|
||||
} \
|
||||
inline STDSTRINGCONSTEXPR bool operator!=(const std::string& rhs) const { \
|
||||
return _hash != Hash(rhs.c_str()); } \
|
||||
return _hash != Hash(rhs.c_str()); \
|
||||
} \
|
||||
inline constexpr bool operator==(const char* rhs) const { return _hash == Hash(rhs); } \
|
||||
inline constexpr bool operator!=(const char* rhs) const { return _hash != Hash(rhs); } \
|
||||
}; \
|
||||
|
|
Loading…
Reference in New Issue