1 #ifndef UVW_TYPE_INFO_INCLUDE_HPP
2 #define UVW_TYPE_INFO_INCLUDE_HPP
22 [[nodiscard]]
static constexpr std::uint32_t fnv1a(
const char *curr) noexcept {
23 constexpr std::uint32_t offset = 2166136261;
24 constexpr std::uint32_t prime = 16777619;
28 value = (value ^
static_cast<std::uint32_t
>(*(curr++))) * prime;
35 [[nodiscard]]
static inline std::uint32_t counter() noexcept {
36 static std::uint32_t cnt{};
41 template<
typename Type>
42 [[nodiscard]]
static std::uint32_t fake() noexcept {
43 static std::uint32_t local = counter();
62 template<
typename Type>
63 [[nodiscard]]
static constexpr std::uint32_t
type() noexcept {
64 #if defined __clang__ || defined __GNUC__
65 return internal::fnv1a(__PRETTY_FUNCTION__);
66 #elif defined _MSC_VER
67 return internal::fnv1a(__FUNCSIG__);
69 return internal::fake();
static constexpr std::uint32_t type() noexcept
Returns a numerical identifier for a given type.