Closed JohelEGP closed 5 years ago
great change. I had in my head at one point that the scales could support really whacky things (like richter scale or other offset scales similar to how temperature is handled), but it was very poorly named and pointlessly complex in the end, in addition to never being exercised.
linearized_value_t
tag to disambiguate theunit
constructor whose value is already linearized.linearize
andscale
static member functions in place of their old constructor andoperator()
respectively. Movem_value
andoperator()
tounit
, where they naturally belong.unit
still inherits fromNumericalScale
, but privately. This is so that the scale traits continue to work.m_value
tolinearized_value
, upgrading its explaining comment to code. [1] [2]constexpr
support fromdecibel_scale
, which uses non-constexpr
std
math functions.has_value_member
, now unused.With this, the fact that the unit values are stored linearized has effectively become an implementation detail, I think.
I think this is desirable as the current scales can be abused because they're publicly bases of
unit
, their constructors were overly accepting, and the non-linear scale concept is underspecified.