Skip to content

Commit

Permalink
refactor: derived_from_the_same_base_dimension no longer needed
Browse files Browse the repository at this point in the history
  • Loading branch information
mpusz committed Oct 9, 2024
1 parent 70a18fe commit 2b1e7ed
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/core/include/mp-units/framework/dimension.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,6 @@ using type_list_of_base_dimension_less = expr_less<T1, T2, base_dimension_less>;
template<DerivedDimensionExpr... Expr>
struct derived_dimension_impl : expr_fractions<is_dimension_one, Expr...> {};

template<auto Symbol>
[[nodiscard]] consteval std::true_type derived_from_the_same_base_dimension(const base_dimension<Symbol>&,
const base_dimension<Symbol>&)
{
return {};
}

[[nodiscard]] consteval std::false_type derived_from_the_same_base_dimension(...) { return {}; }

struct dimension_interface {
template<Dimension Lhs, Dimension Rhs>
[[nodiscard]] friend consteval Dimension auto operator*(Lhs, Rhs)
Expand All @@ -91,9 +82,9 @@ struct dimension_interface {
}

template<Dimension Lhs, Dimension Rhs>
[[nodiscard]] friend consteval bool operator==(Lhs lhs, Rhs rhs)
[[nodiscard]] friend consteval bool operator==(Lhs, Rhs)
{
return is_same_v<Lhs, Rhs> || derived_from_the_same_base_dimension(lhs, rhs);
return is_same_v<Lhs, Rhs>;
}
};

Expand Down

0 comments on commit 2b1e7ed

Please sign in to comment.