forked from mpusz/mp-units
refactor: small code cleanup
This commit is contained in:
@@ -37,7 +37,6 @@
|
|||||||
namespace mp_units {
|
namespace mp_units {
|
||||||
|
|
||||||
MP_UNITS_EXPORT template<QuantitySpec auto QS>
|
MP_UNITS_EXPORT template<QuantitySpec auto QS>
|
||||||
// NOLINTNEXTLINE(bugprone-crtp-constructor-accessibility)
|
|
||||||
struct absolute_point_origin {
|
struct absolute_point_origin {
|
||||||
static constexpr QuantitySpec auto quantity_spec = QS;
|
static constexpr QuantitySpec auto quantity_spec = QS;
|
||||||
};
|
};
|
||||||
|
@@ -153,6 +153,9 @@ struct quantity_spec_interface {
|
|||||||
|
|
||||||
MP_UNITS_EXPORT_BEGIN
|
MP_UNITS_EXPORT_BEGIN
|
||||||
|
|
||||||
|
inline constexpr struct is_kind {
|
||||||
|
} is_kind;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Quantity Specification
|
* @brief Quantity Specification
|
||||||
*
|
*
|
||||||
@@ -178,9 +181,6 @@ template<typename, auto...>
|
|||||||
#endif
|
#endif
|
||||||
struct quantity_spec;
|
struct quantity_spec;
|
||||||
|
|
||||||
inline constexpr struct is_kind {
|
|
||||||
} is_kind;
|
|
||||||
|
|
||||||
MP_UNITS_EXPORT_END
|
MP_UNITS_EXPORT_END
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -45,14 +45,6 @@ struct is_specialization_of_reference<reference<Q, U>> : std::true_type {};
|
|||||||
|
|
||||||
MP_UNITS_EXPORT_BEGIN
|
MP_UNITS_EXPORT_BEGIN
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief A concept matching all references in the library.
|
|
||||||
*
|
|
||||||
* Satisfied by all specializations of @c reference.
|
|
||||||
*/
|
|
||||||
template<typename T>
|
|
||||||
concept Reference = AssociatedUnit<T> || detail::is_specialization_of_reference<T>::value;
|
|
||||||
|
|
||||||
[[nodiscard]] consteval QuantitySpec auto get_quantity_spec(AssociatedUnit auto u);
|
[[nodiscard]] consteval QuantitySpec auto get_quantity_spec(AssociatedUnit auto u);
|
||||||
|
|
||||||
template<typename Q, typename U>
|
template<typename Q, typename U>
|
||||||
@@ -69,6 +61,14 @@ template<typename Q, typename U>
|
|||||||
return U{};
|
return U{};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief A concept matching all references in the library.
|
||||||
|
*
|
||||||
|
* Satisfied by all specializations of @c reference.
|
||||||
|
*/
|
||||||
|
template<typename T>
|
||||||
|
concept Reference = AssociatedUnit<T> || detail::is_specialization_of_reference<T>::value;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief A concept matching all references with provided quantity spec
|
* @brief A concept matching all references with provided quantity spec
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user