From 4ec776172a47341470fc6acbaeb6f31d4f4de6f9 Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Sat, 16 Nov 2024 18:30:46 +0100 Subject: [PATCH] fix: alternative implementation for `IsOfCharacter` --- .../mp-units/framework/representation_concepts.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/core/include/mp-units/framework/representation_concepts.h b/src/core/include/mp-units/framework/representation_concepts.h index bb3a4f71e..d46d33fd5 100644 --- a/src/core/include/mp-units/framework/representation_concepts.h +++ b/src/core/include/mp-units/framework/representation_concepts.h @@ -80,12 +80,18 @@ template concept Tensor = is_tensor; template -constexpr bool IsOfCharacterImpl = - (Ch == quantity_character::scalar && is_scalar) || (Ch == quantity_character::complex && is_complex) || - (Ch == quantity_character::vector && is_vector) || (Ch == quantity_character::tensor && is_tensor); +constexpr bool is_of_character_impl = false; +template +constexpr bool is_of_character_impl = is_scalar; +template +constexpr bool is_of_character_impl = is_complex; +template +constexpr bool is_of_character_impl = is_vector; +template +constexpr bool is_of_character_impl = is_tensor; template -concept IsOfCharacter = IsOfCharacterImpl; +concept IsOfCharacter = is_of_character_impl; template using scaling_factor_type_t = conditional, long double, std::intmax_t>;