Closed JohelEGP closed 5 years ago
yeah, removing the template would be more idiomatic.
yeah, removing the template would be more idiomatic.
Am I correct to assume that you agree with the "further simplification" as posted in the second part of the OP? I'm asking because I was going to implement that.
The commit for (manually) closing this PR looks wrong and doesn't include a part of the changes, presumably due to the conflicts (for having added linearized_value
).
yes agree to the second part. go ahead and deconflict as much as you can, especially #150.
On Fri, Oct 26, 2018 at 2:41 PM Johel Ernesto Guerrero Peña < notifications@github.com> wrote:
yeah, removing the template would be more idiomatic.
Am I correct to assume that you agree with the "further simplification" as posted in the second part of the OP? I'm asking because I was going to implement that.
The commit for (manually) closing this PR looks wrong and doesn't include a part of the changes, presumably due to the conflicts (for having added linearized_value).
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/nholthaus/units/pull/193#issuecomment-433505890, or mute the thread https://github.com/notifications/unsubscribe-auth/AJ2HH9FxjIcuQTefAdbxftQ32br3ekp2ks5uo1dygaJpZM4XMG-H .
By defaulting
units::toLinearized
's return type to the unit'sunderlying_type
, call sites that don't need something else get simpler.What do you think about simplifying it further, so that it's not a template function? Changing
x.template toLinearized<Arithmetic>()
forstatic_cast<Arithmetic>(x.toLinearized())
is, I believe, more clear on the intention and easier to read at call site.