diff --git a/include/cpp_event_framework/DemangledTypeName.hxx b/include/cpp_event_framework/DemangledTypeName.hxx index 9ffc154..876dfc7 100644 --- a/include/cpp_event_framework/DemangledTypeName.hxx +++ b/include/cpp_event_framework/DemangledTypeName.hxx @@ -20,12 +20,21 @@ namespace cpp_event_framework { +/** + * @brief Convert a string view to a std::array + * + * @tparam Idxs + */ template constexpr auto SubstringAsArray(std::string_view str, std::index_sequence /*idx*/) { return std::array{str[Idxs]..., '\0'}; } +/** + * @brief Convert type name to std::array + * + */ template constexpr auto TypeNameArray() { @@ -54,12 +63,26 @@ constexpr auto TypeNameArray() return SubstringAsArray(kName, std::make_index_sequence{}); } +/** + * @brief Static storage for type name class + * + */ template struct TypeNameHolder { + /** + * @brief Static storage for type name + * + */ static constexpr auto kValue = TypeNameArray(); }; +/** + * @brief Get the Demangled type name as NULL terminated const char* + * + * @tparam T + * @return constexpr const char* + */ template constexpr const char* GetDemangledTypeName() {