Implements .Empty method on constString types.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-02-27 18:05:24 +01:00
parent e9d36a6237
commit 4c36946496
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
1 changed files with 5 additions and 2 deletions

View File

@ -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); } \
}; \