boostorg / core

Boost Core Utilities
132 stars 86 forks source link

add nameof into boost::core::demangle.hpp #166

Open gpeterhoff opened 4 months ago

gpeterhoff commented 4 months ago
#include <typeinfo>

namespace boost
{
namespace core
{
template <typename Type>
inline std::string  nameof()
{
    return demangle(typeid(Type).name());
}

}   //  core
}   //  boost

This saves a lot of manual fiddling around.

thx Gero

pdimov commented 4 months ago

See boost::core::type_name.

gpeterhoff commented 4 months ago

Thank you. I overlooked that.

regards Gero