Skip to content

Commit

Permalink
Merge branch 'concept-quantity' into concept-quantity-bis
Browse files Browse the repository at this point in the history
  • Loading branch information
eggrobin committed Mar 23, 2024
2 parents d0008af + 27e3872 commit 3146cf9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions quantities/concepts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,12 @@ concept real_affine_space = affine_space<V, double>;
template<typename T>
concept quantity = instance_of<T, Quantity> || std::same_as<T, double>;

// std::integral || std::floating_point rather than
// std::convertible_to<double, T> because
// the former introduces ambiguities on Sign * Vector.
template<typename T>
concept convertible_to_quantity =
std::convertible_to<T, double> || quantity<std::remove_cvref_t<T>>;
concept convertible_to_quantity = quantity<std::remove_cvref_t<T>> ||
std::integral<T> || std::floating_point<T>;

} // namespace internal

Expand Down

0 comments on commit 3146cf9

Please sign in to comment.