2#include "gaia/config/config.h"
4#include "gaia/core/hashing_policy.h"
5#include "gaia/core/span.h"
17 constexpr static size_t find_first_of(
const char* data,
size_t len,
char toFind,
size_t startPos = 0) {
18 for (
size_t i = startPos; i < len; ++i) {
19 if (data[i] == toFind)
25 constexpr static size_t find_last_of(
const char* data,
size_t len,
char c,
size_t startPos =
size_t(-1)) {
26 const auto minValue = startPos <= len - 1 ? startPos : len - 1;
27 for (int64_t i = (int64_t)minValue; i >= 0; --i) {
39 GAIA_NODISCARD
static constexpr const char*
full_name() noexcept {
40 return GAIA_PRETTY_FUNCTION;
47 GAIA_NODISCARD
static constexpr auto name() noexcept {
64 while (GAIA_PRETTY_FUNCTION[strLen] !=
'\0')
67 std::span<const char>
name{GAIA_PRETTY_FUNCTION, strLen};
68 const auto prefixPos = find_first_of(
name.data(),
name.size(), GAIA_PRETTY_FUNCTION_PREFIX);
69 const auto start = find_first_of(
name.data(),
name.size(),
' ', prefixPos + 1);
70 const auto end = find_last_of(
name.data(),
name.size(), GAIA_PRETTY_FUNCTION_SUFFIX);
71 return name.subspan(start + 1, end - start - 1);
78 GAIA_NODISCARD
static constexpr auto hash() noexcept {
79#if GAIA_COMPILER_MSVC && _MSC_VER <= 1916
80 GAIA_MSVC_WARNING_PUSH()
81 GAIA_MSVC_WARNING_DISABLE(4307)
85 return core::calculate_hash64(n.data(), n.size());
87#if GAIA_COMPILER_MSVC && _MSC_VER <= 1916
88 GAIA_MSVC_WARNING_PUSH()