feat: type_name(T) added
This commit is contained in:
1 parent
40f7f70e3e
commit
710eda7737
1 file changed
+6
@@ -41,6 +41,12 @@ template<typename T>
|
||||
template<typename Lhs, typename Rhs>
|
||||
struct type_name_less : std::bool_constant<type_name<Lhs>() < type_name<Rhs>()> {};
|
||||
|
||||
template<typename T>
|
||||
[[nodiscard]] consteval std::string_view type_name(T)
|
||||
{
|
||||
return type_name<T>();
|
||||
}
|
||||
|
||||
// This is typically used to deterministically chose one of the alternatives
|
||||
// to guarantee the commutation of the operation (e.g., `a + b` should return
|
||||
// the same type as `b + a`).
|
||||
|
||||
Reference in new issue
Block a user