Skip to content

Commit

Permalink
ambiguity
Browse files Browse the repository at this point in the history
  • Loading branch information
eggrobin committed Mar 23, 2024
1 parent 894ef4f commit 184a4de
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion quantities/concepts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,12 @@ concept affine_space = requires(A x, A y) {
template<typename V>
concept real_affine_space = affine_space<V, 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> ||
std::integral<T> || std::floating_point<T> ||
is_instance_of_v<Quantity, std::remove_cvref_t<T>>;

} // namespace internal
Expand Down

0 comments on commit 184a4de

Please sign in to comment.