nholthaus / units

a compile-time, header-only, dimensional analysis and unit conversion library built on c++14 with no dependencies.
http://nholthaus.github.io/units/
MIT License
938 stars 134 forks source link

[Vote] Are unit domain namespaces necessary/desirable in v3? #250

Open nholthaus opened 3 years ago

nholthaus commented 3 years ago

It seems to me v2.3, as a whole, over-uses namespaces (e.g. units::math), with the effect of breaking ADL or having it behave counter-intuitively.

It's obvious that math and non-member functions should be moved out of domain namespaces, but I think it begs the question of whether or not all definitions should be moved into the unit namespace.

The original intent was to avoid name clashes like weight/volume 'ounces', but there are relatively few, and they generally have canonical de-conflicted names.

Should we remove all domain-specific namespaces for the next release?

JohelEGP commented 3 years ago

like weight/volume 'ounces'

Is this a cross-system clash? mp-units has namespaces for each systems, which tells me that the current design of this library, which has namespaces per dimension, like units::length, would still have clashes for cross-system units with units of the same name and the same dimension. I vaguely remember there being one such case for the length dimension.