Closed JohelEGP closed 6 years ago
Here's a diff of errors based on these Compiler Explorer sources. It seems that the lack of strong typing can pull some overloads from elsewhere.
looks great. The improvement to the error messages is phenomenal. I pulled the header split PR first so I think once the conflicts are resolved this is ready to go.
Good news. I'll look into into it.
Rebased. clang-format was ran on the conversion_factor
renaming.
hmm, I must have visual studio set up to autorun it. I'll turn that off.
I meant to say that the code was auto formatted for me. You should turn it on.
roger that.
Resolves #160 to prevent having to prefix the
unit_conversion
tags everywhere so that they're valid outside their namespace here.The new type trait,
strong
, maps aunit_conversion
to its strong type alias. They are used as late as possible to prevent ODR issues. Manipulators likesquared
don't use it as they're used in the definition of units. See, for example:This declares
degrees_squared
as a strong type alias ofsquared<angle::degrees>
, and then specializesstrong
so thatstrong_t<squared<angle::degrees>>
namesdegrees_squared
. Ifsquared
usedstrong_t
, then the meaning ofsquared<angle::degrees>
would change after this unit definition.