For types that are math-like, I am in the habit of putting operators like abs in the same namespace so they are found by ADL if I do the std::swap two-step as in
template <typename T>
[[nodiscard]] auto myGenericFunction(T x) {
using std::abs;
x = abs(x); // Finds std::abs for T == double, but finds abs by ADL otherwise.
...
Having them in ::units::math breaks that, and there's not really a solution in generic code.
For types that are math-like, I am in the habit of putting operators like
abs
in the same namespace so they are found by ADL if I do thestd::swap
two-step as inHaving them in
::units::math
breaks that, and there's not really a solution in generic code.