mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-04 20:54:28 +02:00
TODO comments clean-up
This commit is contained in:
@@ -81,7 +81,7 @@ public:
|
||||
#if __GNUC__ >= 10
|
||||
|
||||
[[nodiscard]] friend constexpr auto operator<=>(const measurement& lhs, const measurement& rhs) = default;
|
||||
[[nodiscard]] friend constexpr bool operator==(const measurement& lhs, const measurement& rhs) = default;
|
||||
[[nodiscard]] friend constexpr bool operator==(const measurement& lhs, const measurement& rhs) = default; // TODO op== not needed (gcc bug)
|
||||
|
||||
#else
|
||||
|
||||
|
@@ -50,7 +50,7 @@ namespace units {
|
||||
template<basic_fixed_string Symbol, Unit U>
|
||||
requires U::is_named
|
||||
struct base_dimension {
|
||||
using base_type_workaround = base_dimension; // TODO Replace with is_derived_from_instantiation when fixed
|
||||
using base_type_workaround = base_dimension; // TODO Replace with is_base_dimension when fixed
|
||||
static constexpr auto symbol = Symbol;
|
||||
using base_unit = U;
|
||||
};
|
||||
|
@@ -220,6 +220,8 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
// Hidden Friends
|
||||
// Below friend functions are to be found via argument-dependent lookup only
|
||||
#if __GNUC__ >= 10
|
||||
|
||||
template<typename D2, typename U2, typename Rep2>
|
||||
@@ -355,7 +357,7 @@ template<typename D1, typename U1, typename Rep1, typename D2, typename U2, type
|
||||
|
||||
template<typename D1, typename U1, typename Rep1, typename D2, typename U2, typename Rep2>
|
||||
[[nodiscard]] constexpr Quantity AUTO operator*(const quantity<D1, U1, Rep1>& lhs, const quantity<D2, U2, Rep2>& rhs)
|
||||
requires detail::basic_arithmetic<Rep1, Rep2> && (!equivalent_dim<D1, dim_invert<D2>>) // TODO equivalent_derived_dim?
|
||||
requires detail::basic_arithmetic<Rep1, Rep2> && (!equivalent_dim<D1, dim_invert<D2>>)
|
||||
{
|
||||
using dim = dimension_multiply<D1, D2>;
|
||||
using ratio1 = ratio_divide<typename U1::ratio, typename dimension_unit<D1>::ratio>;
|
||||
@@ -405,7 +407,7 @@ template<typename D1, typename U1, typename Rep1, typename D2, typename U2, type
|
||||
|
||||
template<typename D1, typename U1, typename Rep1, typename D2, typename U2, typename Rep2>
|
||||
[[nodiscard]] constexpr Quantity AUTO operator/(const quantity<D1, U1, Rep1>& lhs, const quantity<D2, U2, Rep2>& rhs)
|
||||
requires detail::basic_arithmetic<Rep1, Rep2> && (!equivalent_dim<D1, D2>) // TODO equivalent_derived_dim?
|
||||
requires detail::basic_arithmetic<Rep1, Rep2> && (!equivalent_dim<D1, D2>)
|
||||
{
|
||||
Expects(rhs.count() != 0);
|
||||
|
||||
|
@@ -135,10 +135,6 @@ struct named_scaled_unit : downcast_child<Child, scaled_unit<ratio_multiply<R, t
|
||||
*/
|
||||
template<typename Child, Prefix P, Unit U>
|
||||
requires std::same_as<typename P::prefix_type, typename U::prefix_type>
|
||||
// TODO replace with the below code when gcc will stop to crash on it ;-)
|
||||
// struct prefixed_unit : named_scaled_unit<Child, P::symbol + U::symbol, typename P::prefix_type,
|
||||
// ratio_multiply<typename P::ratio, typename U::ratio>,
|
||||
// typename U::reference> {};
|
||||
struct prefixed_unit :
|
||||
downcast_child<Child, scaled_unit<ratio_multiply<typename P::ratio, typename U::ratio>, typename U::reference>> {
|
||||
static constexpr bool is_named = true;
|
||||
|
Reference in New Issue
Block a user