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
947 stars 135 forks source link

inline namespace constants #202

Closed nholthaus closed 5 years ago

nholthaus commented 5 years ago

in the spirit of our other namespace inlining, I'm inlining the constants namespace as well

coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 4cbe8b46ebac362d8daf23a4b20aa18e75e63f89 on inline-constants-namespace into dca7db29c7186b9773d73bd249462436284e3444 on v3.x.

JohelEGP commented 5 years ago

I hadn't suggested it due to constants like h, which clash with their equivalently named conversion_factor, due to my desire now expressed in #196, and future constants possibly having the same problem. Not that I suggest using the conversion_factors with the abbreviated name.

nholthaus commented 5 years ago

yeah I think we should just change the names of the factors right?

On Fri, Oct 26, 2018 at 3:47 PM Johel Ernesto Guerrero Peña < notifications@github.com> wrote:

I hadn't suggested it due to constants like h, which clash with their equivalently named conversion_factor, due to my desire now expressed in

196 https://github.com/nholthaus/units/issues/196, and future

constants possibly having the same problem. Not that I suggest using the conversion_factors with the abbreviated name.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/nholthaus/units/pull/202#issuecomment-433523172, or mute the thread https://github.com/notifications/unsubscribe-auth/AJ2HH0cH_4y_7unZvX9l9dGRJ8wkHUcKks5uo2bcgaJpZM4X80J7 .

JohelEGP commented 5 years ago

What do you mean? Right now, we have m, meter and meters, which are conversion_factors, and the unit meter_t. Following the units' renaming, there would be m and meter, and meters, respectively. There's also the issue of https://github.com/nholthaus/units/issues/159#issuecomment-427608557.

nholthaus commented 5 years ago

@johelegp once I clear the PR queue, I'm thinking of ding the unit rename, e,g. removing the _t. To do that, I'll first have to change the conversion factor names. I'm thinking unit_name_singular + _conversion. What do you think?

Once that's done, the abbreviations will be free again and we can do the h(1) defines, as well as define the SI unit of each dimension in core.h

JohelEGP commented 5 years ago

That sounds good. I'll tell you if I can come up with anything better.