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
961 stars 137 forks source link

Turn the unit aliases into template aliases #176

Closed JohelEGP closed 6 years ago

JohelEGP commented 6 years ago

Resolves #138 Resolves #175 and part of #169.

JohelEGP commented 6 years ago

Adding the changes to unit and abbreviation done in #150 should fix the remaining errors. I'll do it some time later.

JohelEGP commented 6 years ago

Tell me if I should split 1435f5d into its own PR. Otherwise, this one is ready.

nholthaus commented 6 years ago

it's fine this way. Did you already try creating a deduction guide for <double> units so users don't have to use templates if they don't want to? If not, I'll work on it some today.

JohelEGP commented 6 years ago

I did try, and failed to conciliate CTAD and defaulting the underlying type to = double.

nholthaus commented 6 years ago

I'll take another look when we pull strong units. We don't necessarily need a default underlying type anymore, but it would be really nice to deduce the underlying type during construction. It seems like it should be possible to me.