mirror of
https://github.com/mpusz/mp-units.git
synced 2025-07-31 10:57:16 +02:00
refactor: 💥 Unit<T>
concept now requires T
to be marked final
This commit is contained in:
@ -137,14 +137,7 @@ void is_unit_impl(const derived_unit<Expr...>*);
|
|||||||
void is_unit_impl(const one*);
|
void is_unit_impl(const one*);
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
inline constexpr bool is_specialization_of_prefixed_unit = false;
|
requires requires(T* t) { is_unit_impl(t); } && std::is_final_v<T>
|
||||||
|
|
||||||
template<symbol_text Symbol, Magnitude auto M, PrefixableUnit auto U>
|
|
||||||
inline constexpr bool is_specialization_of_prefixed_unit<prefixed_unit<Symbol, M, U>> = true;
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
requires requires(T* t) { is_unit_impl(t); } && (!is_specialization_of_named_unit<T>) &&
|
|
||||||
(!is_specialization_of_prefixed_unit<T>)
|
|
||||||
inline constexpr bool is_unit<T> = true;
|
inline constexpr bool is_unit<T> = true;
|
||||||
|
|
||||||
template<Unit U>
|
template<Unit U>
|
||||||
|
Reference in New Issue
Block a user