TODO comments clean-up

This commit is contained in:
Mateusz Pusz
2019-12-17 20:15:38 +01:00
parent 80a13b1a94
commit 3decaecb52
4 changed files with 6 additions and 8 deletions

View File

@@ -81,7 +81,7 @@ public:
#if __GNUC__ >= 10 #if __GNUC__ >= 10
[[nodiscard]] friend constexpr auto operator<=>(const measurement& lhs, const measurement& rhs) = default; [[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 #else

View File

@@ -50,7 +50,7 @@ namespace units {
template<basic_fixed_string Symbol, Unit U> template<basic_fixed_string Symbol, Unit U>
requires U::is_named requires U::is_named
struct base_dimension { 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; static constexpr auto symbol = Symbol;
using base_unit = U; using base_unit = U;
}; };

View File

@@ -220,6 +220,8 @@ public:
return *this; return *this;
} }
// Hidden Friends
// Below friend functions are to be found via argument-dependent lookup only
#if __GNUC__ >= 10 #if __GNUC__ >= 10
template<typename D2, typename U2, typename Rep2> 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> 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) [[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 dim = dimension_multiply<D1, D2>;
using ratio1 = ratio_divide<typename U1::ratio, typename dimension_unit<D1>::ratio>; 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> 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) [[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); Expects(rhs.count() != 0);

View File

@@ -135,10 +135,6 @@ struct named_scaled_unit : downcast_child<Child, scaled_unit<ratio_multiply<R, t
*/ */
template<typename Child, Prefix P, Unit U> template<typename Child, Prefix P, Unit U>
requires std::same_as<typename P::prefix_type, typename U::prefix_type> 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 : struct prefixed_unit :
downcast_child<Child, scaled_unit<ratio_multiply<typename P::ratio, typename U::ratio>, typename U::reference>> { downcast_child<Child, scaled_unit<ratio_multiply<typename P::ratio, typename U::ratio>, typename U::reference>> {
static constexpr bool is_named = true; static constexpr bool is_named = true;