Skip to content

Commit

Permalink
Merge branch 'master' into ref_docs
Browse files Browse the repository at this point in the history
  • Loading branch information
JohelEGP authored Nov 2, 2024
2 parents a4502de + 80a4d6b commit 111f24a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/core/include/mp-units/framework/quantity_concepts.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ template<typename T, template<typename> typename Traits>
concept QuantityLikeImpl = requires(const T& qty, const Traits<T>::rep& num) {
{ Traits<T>::to_numerical_value(qty) } -> std::same_as<typename Traits<T>::rep>;
{ Traits<T>::from_numerical_value(num) } -> std::same_as<T>;
{ Traits<T>::explicit_import } -> std::convertible_to<bool>;
{ Traits<T>::explicit_export } -> std::convertible_to<bool>;
requires std::same_as<decltype(Traits<T>::explicit_import), const bool>;
requires std::same_as<decltype(Traits<T>::explicit_export), const bool>;
typename std::bool_constant<Traits<T>::explicit_import>;
typename std::bool_constant<Traits<T>::explicit_export>;
};

} // namespace detail
Expand Down
4 changes: 2 additions & 2 deletions src/core/include/mp-units/framework/quantity_point.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ struct point_origin_interface {
[[nodiscard]] friend constexpr Quantity auto operator-(PO1 po1, PO2 po2)
{
if constexpr (is_derived_from_specialization_of_v<PO1, absolute_point_origin>) {
return -(po2.quantity_point - po2.quantity_point.absolute_point_origin);
return po1 - po2.quantity_point;
} else if constexpr (is_derived_from_specialization_of_v<PO2, absolute_point_origin>) {
return po1.quantity_point - po1.quantity_point.absolute_point_origin;
return po1.quantity_point - po2;
} else {
return po1.quantity_point - po2.quantity_point;
}
Expand Down

0 comments on commit 111f24a

Please sign in to comment.