27 #include "Portability.h" 28 #include "StringRef.h" 31 #ifndef DOXYGEN_SHOULD_SKIP_THIS 63 constexpr
Id hash(
const char *str, std::size_t sz) {
64 Id value = UINT64_C(0xcbf29ce484222325);
66 for (std::size_t i = 0; i < sz; ++i) {
67 value ^=
static_cast<unsigned char>(str[i]);
68 value *= UINT64_C(0x100000001b3);
104 constexpr
gf::Id operator"" _id(
const char *str, std::size_t sz) {
110 #ifndef DOXYGEN_SHOULD_SKIP_THIS constexpr const char * getData() const noexcept
Get a pointer to the string.
Definition: StringRef.h:127
uint64_t Id
An identifier.
Definition: Id.h:39
constexpr Id hash(const char *str, std::size_t sz)
Get an identifier from a string.
Definition: Id.h:63
The namespace for gf classes.
Definition: Action.h:35
A constant reference to a string and its size.
Definition: StringRef.h:41
constexpr Id InvalidId
The invalid id (which is 0)
Definition: Id.h:45
constexpr std::size_t getSize() const noexcept
Get the size of the string.
Definition: StringRef.h:136