I've got a simple macro
#define DESCRIBED(Class, ...) template<>\
struct TypeDescriptor<Class>\
{\
static constexpr std::string_view memberString{#__VA_ARGS__};\
};\
but I'm wondering if there is a way to not use macro
something like this:
template<typename T, typename ... Args>
struct TypeDescriptor
{
static constexpr std::string_view memberString{ /* some magic to cast args to string */ Args...};
};
is it possible?
I've seen C++ Get name of type in template but typeid(T).name()
is not constexpr, so I cannot use static constexpr std::string_view