From 19a201920498e169399762b0d6ec20b23e991f09 Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Fri, 29 Nov 2024 21:20:37 +0100 Subject: [PATCH] feat: proper constraints for `kind_of` --- src/core/include/mp-units/framework/quantity_spec.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/include/mp-units/framework/quantity_spec.h b/src/core/include/mp-units/framework/quantity_spec.h index c4497681..e7f1b7c2 100644 --- a/src/core/include/mp-units/framework/quantity_spec.h +++ b/src/core/include/mp-units/framework/quantity_spec.h @@ -499,7 +499,7 @@ template } // namespace detail -template +template requires(!detail::QuantityKindSpec) && (detail::get_kind_tree_root(Q{}) == Q{}) #if MP_UNITS_API_NO_CRTP struct kind_of_ final : Q::_base_type_ { @@ -510,7 +510,7 @@ struct kind_of_ final : quantity_spec, Q{}>::_base_type_ { static constexpr auto _quantity_spec_ = Q{}; }; -MP_UNITS_EXPORT template +MP_UNITS_EXPORT template requires requires { typename kind_of_; } constexpr kind_of_ kind_of;