refactor: small code cleanup

This commit is contained in:
Mateusz Pusz
2024-06-30 12:10:04 +02:00
parent 13aab34b51
commit a70031ab75
3 changed files with 11 additions and 12 deletions

View File

@@ -37,7 +37,6 @@
namespace mp_units {
MP_UNITS_EXPORT template<QuantitySpec auto QS>
// NOLINTNEXTLINE(bugprone-crtp-constructor-accessibility)
struct absolute_point_origin {
static constexpr QuantitySpec auto quantity_spec = QS;
};

View File

@@ -153,6 +153,9 @@ struct quantity_spec_interface {
MP_UNITS_EXPORT_BEGIN
inline constexpr struct is_kind {
} is_kind;
/**
* @brief Quantity Specification
*
@@ -178,9 +181,6 @@ template<typename, auto...>
#endif
struct quantity_spec;
inline constexpr struct is_kind {
} is_kind;
MP_UNITS_EXPORT_END
/**

View File

@@ -45,14 +45,6 @@ struct is_specialization_of_reference<reference<Q, U>> : std::true_type {};
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);
template<typename Q, typename U>
@@ -69,6 +61,14 @@ template<typename Q, typename 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
*