Hi, I've a design question for you: I can't understand why NonLinearScale must be a trivial type.
I've read the code, but I couldn't find any point where this triviality is exploited. I mean, yes, this way a unit_t must a trivial type, but with this restriction I can't make an unit based on, for example,
boost::multiprecision numbers such as cpp_int and float128
std::complex<T>
std::valarray<T>
any user-defined type which initialize to zero its storage
Even without this restriction, a unit_t based on a trivial type remains trivial, so removing this constraint doesn't seems to have real downsides; it seems to me that default_constructible is sufficient for a type to be used with a NonLinearScale.
Am I missing something? It would be possible to remove the constraint safely?
Hi, I've a design question for you: I can't understand why
NonLinearScale
must be atrivial
type. I've read the code, but I couldn't find any point where this triviality is exploited. I mean, yes, this way aunit_t
must a trivial type, but with this restriction I can't make an unit based on, for example,boost::multiprecision
numbers such ascpp_int
andfloat128
std::complex<T>
std::valarray<T>
Even without this restriction, a
unit_t
based on atrivial
type remains trivial, so removing this constraint doesn't seems to have real downsides; it seems to me thatdefault_constructible
is sufficient for a type to be used with a NonLinearScale. Am I missing something? It would be possible to remove the constraint safely?Thanks