From 710eda7737d432512211f9e087c823475c5deebd Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Mon, 28 Apr 2025 15:22:05 +0200 Subject: [PATCH] feat: `type_name(T)` added --- src/core/include/mp-units/ext/type_name.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/include/mp-units/ext/type_name.h b/src/core/include/mp-units/ext/type_name.h index 403ecd65..7f478fc8 100644 --- a/src/core/include/mp-units/ext/type_name.h +++ b/src/core/include/mp-units/ext/type_name.h @@ -41,6 +41,12 @@ template template struct type_name_less : std::bool_constant() < type_name()> {}; +template +[[nodiscard]] consteval std::string_view type_name(T) +{ + return type_name(); +} + // 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`).