forked from Alepha/Alepha
Fancy type name facility.
This commit is contained in:
@ -0,0 +1,4 @@
|
|||||||
|
target_sources( alepha PRIVATE
|
||||||
|
fancyTypeName.cc
|
||||||
|
)
|
||||||
|
|
||||||
|
14
Utility/fancyTypeName.cc
Normal file
14
Utility/fancyTypeName.cc
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
static_assert( __cplusplus > 2020'99 );
|
||||||
|
|
||||||
|
#include "fancyTypeName.h"
|
||||||
|
|
||||||
|
#include <boost/core/demangle.hpp>
|
||||||
|
|
||||||
|
namespace Alepha::Hydrogen::Utility::detail::fancyTypeName_m
|
||||||
|
{
|
||||||
|
std::string
|
||||||
|
fancyTypeName( const std::type_index idx )
|
||||||
|
{
|
||||||
|
return boost::core::demangle( idx.name() );
|
||||||
|
}
|
||||||
|
}
|
23
Utility/fancyTypeName.h
Normal file
23
Utility/fancyTypeName.h
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
static_assert( __cplusplus > 2020'99 );
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <Alepha/Alepha.h>
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <typeindex>
|
||||||
|
|
||||||
|
namespace Alepha::Hydrogen::Utility ::detail:: fancyTypeName_m
|
||||||
|
{
|
||||||
|
inline namespace exports
|
||||||
|
{
|
||||||
|
std::string fancyTypeName( std::type_index );
|
||||||
|
|
||||||
|
template< typename T > std::string fancyTypeName() { return fancyTypeName( typeid( T ) ); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace Alepha::Hydrogen::Utility::inline exports::inline fancyTypeName_m
|
||||||
|
{
|
||||||
|
using namespace detail::fancyTypeName_m::exports;
|
||||||
|
}
|
Reference in New Issue
Block a user