forked from mpusz/mp-units
refactor: derived_from concepts refactored
This commit is contained in:
@@ -61,7 +61,7 @@ void to_prefix_base(const volatile prefix_base<PF, R>*);
|
||||
* Satisfied by all specializations of `prefix`.
|
||||
*/
|
||||
template<typename T>
|
||||
concept Prefix = requires(const volatile T* t) { detail::to_prefix_base(t); };
|
||||
concept Prefix = requires(T* t) { detail::to_prefix_base(t); };
|
||||
|
||||
/**
|
||||
* @brief A concept matching unit's ratio
|
||||
@@ -90,7 +90,7 @@ void to_base_scaled_unit(const volatile scaled_unit<R, U>*);
|
||||
* Satisfied by all unit types derived from an specialization of :class:`scaled_unit`.
|
||||
*/
|
||||
template<typename T>
|
||||
concept Unit = requires { detail::to_base_scaled_unit(std::declval<const volatile T*>()); };
|
||||
concept Unit = requires(T* t) { detail::to_base_scaled_unit(t); };
|
||||
|
||||
// BaseDimension
|
||||
template<basic_fixed_string Symbol, Unit U>
|
||||
@@ -110,7 +110,7 @@ void to_base_base_dimension(const volatile base_dimension<Symbol, U>*);
|
||||
* Satisfied by all dimension types derived from an specialization of `base_dimension`.
|
||||
*/
|
||||
template<typename T>
|
||||
concept BaseDimension = requires { detail::to_base_base_dimension(std::declval<const volatile T*>()); };
|
||||
concept BaseDimension = requires(T* t) { detail::to_base_base_dimension(t); };
|
||||
|
||||
// Exponent
|
||||
namespace detail {
|
||||
|
@@ -75,6 +75,6 @@ void to_base_specialization_of(const volatile Type<Params...>*);
|
||||
|
||||
template<typename T, template<typename...> typename Type>
|
||||
// inline constexpr bool // TODO: Replace with concept when it works with MSVC
|
||||
concept is_derived_from_specialization_of = requires { detail::to_base_specialization_of<Type>(std::declval<const volatile T*>()); };
|
||||
concept is_derived_from_specialization_of = requires(T* t) { detail::to_base_specialization_of<Type>(t); };
|
||||
|
||||
} // namespace units
|
||||
|
Reference in New Issue
Block a user