Struct type_name

Synopsis

#include <src/entt/core/type_info.hpp>

template<typename Type, typename = void>
struct type_name final

Description

Type name.

Template Parameters

Type - Type for which to generate a name.

Mentioned in

Methods

valueReturns the name of a given type.

Source

Lines 105-126 in src/entt/core/type_info.hpp.

template<typename Type, typename = void>
struct type_name final {
    /**
     * @brief Returns the name of a given type.
     * @return The name of the given type.
     */
#if defined ENTT_PRETTY_FUNCTION_CONSTEXPR
    [[nodiscard]] static constexpr std::string_view value() ENTT_NOEXCEPT {
        constexpr auto value = internal::type_name<Type>();
        return value;
    }
#elif defined ENTT_PRETTY_FUNCTION
    [[nodiscard]] static std::string_view value() ENTT_NOEXCEPT {
        static const auto value = internal::type_name<Type>();
        return value;
    }
#else
    [[nodiscard]] static constexpr std::string_view value() ENTT_NOEXCEPT {
        return internal::type_name<Type>();
    }
#endif
};





Add Discussion

Log in to comment