So I have this really ugly code:
template
std::conditional_t
The template version of a switch statement is a specialized template.
template struct matching_type;
template<> struct matching_type { typedef char type; };
template<> struct matching_type { typedef short type; };
template<> struct matching_type { typedef int type; };
template<> struct matching_type { typedef long type; };
template<> struct matching_type { typedef long long type; };
template
matching_type::type foo(T bar)
{
return reinterpret_cast(bar);
}