mp-units icon indicating copy to clipboard operation
mp-units copied to clipboard

Future `units` clash when `using namespace std;`

Open JohelEGP opened this issue 2 years ago • 3 comments

The same issue at https://github.com/ericniebler/range-v3/issues/1271 will happen here, if mp-units hopefully makes it to the Standard. Because the library will be proposed in parts, and not everything will be standardized, so users will have reasons to continue using mp-units.

JohelEGP avatar Nov 23 '21 22:11 JohelEGP

I was not aware of this issue but actually, a few days ago I considered changing the namespace (and the include directory name) to mp_units just to clean things up as it may also collide with other potential units libraries installed on the filesystem. I decided to not do it then as it was not much benefit and could break the users we already have.

But your issue sheds new light on this subject. Probably we should consider doing such a change for the next release.

mpusz avatar Nov 24 '21 07:11 mpusz

@JohelEGP, do you have a suggestion what is the best way to proceed here? I would like to make this change in the new framework, as we are breaking users' code already. Should we just rename the namespace and the includes header directory to mp_units, or maybe should we do something fancier?

mpusz avatar Sep 09 '22 12:09 mpusz

Should we just rename the namespace and the includes header directory to mp_units

That's good enough.

JohelEGP avatar Sep 09 '22 12:09 JohelEGP