diff --git a/src/include/units/concepts.h b/src/include/units/concepts.h index 45cf4c9a..7f7acc7c 100644 --- a/src/include/units/concepts.h +++ b/src/include/units/concepts.h @@ -43,17 +43,21 @@ template concept PrefixFamily = std::derived_from; // Prefix -// TODO gcc:92150 -// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92150 -// namespace detail { +template +struct prefix_base; -// template -// inline constexpr bool is_prefix = false; +namespace detail { -// template -// inline constexpr bool is_prefix> = true; +struct is_derived_from_prefix_base_impl { + template + static constexpr std::true_type check_base(const prefix_base&); + static constexpr std::false_type check_base(...); +}; -// } // namespace detail +template +inline constexpr bool is_derived_from_prefix_base = decltype(is_derived_from_prefix_base_impl::check_base(std::declval()))::value; + +} // namespace detail /** * @brief A concept matching a symbol prefix @@ -61,9 +65,8 @@ concept PrefixFamily = std::derived_from; * Satisfied by all specializations of `prefix`. */ template -// concept Prefix = detail::is_prefix; -concept Prefix = true; - +// concept Prefix = detail::is_derived_from_prefix_base; +concept Prefix = true; // TODO: still some bug out there :-( /** * @brief A concept matching unit's ratio