16 constexpr static size_t find_first_of(
const char* data,
size_t len,
char toFind,
size_t startPos = 0) {
17 for (
size_t i = startPos; i < len; ++i) {
18 if (data[i] == toFind)
24 constexpr static size_t find_last_of(
const char* data,
size_t len,
char c,
size_t startPos =
size_t(-1)) {
25 const auto minValue = startPos <= len - 1 ? startPos : len - 1;
26 for (int64_t i = (int64_t)minValue; i >= 0; --i) {
35 GAIA_NODISCARD
static constexpr const char* full_name()
noexcept {
36 return GAIA_PRETTY_FUNCTION;
40 GAIA_NODISCARD
static constexpr auto name()
noexcept {
57 while (GAIA_PRETTY_FUNCTION[strLen] !=
'\0')
61 const auto prefixPos = find_first_of(name.data(), name.size(), GAIA_PRETTY_FUNCTION_PREFIX);
62 const auto start = find_first_of(name.data(), name.size(),
' ', prefixPos + 1);
63 const auto end = find_last_of(name.data(), name.size(), GAIA_PRETTY_FUNCTION_SUFFIX);
64 return name.subspan(start + 1, end - start - 1);
68 GAIA_NODISCARD
static constexpr auto hash()
noexcept {
69#if GAIA_COMPILER_MSVC && _MSC_VER <= 1916
70 GAIA_MSVC_WARNING_PUSH()
71 GAIA_MSVC_WARNING_DISABLE(4307)
75 return core::calculate_hash64(n.data(), n.size());
77#if GAIA_COMPILER_MSVC && _MSC_VER <= 1916
78 GAIA_MSVC_WARNING_PUSH()