On Tuesday, 3 June 2014 at 17:01:15 UTC, Jonathan M Davis via
Digitalmars-d wrote:
As of Sunday. The problem is that they seem to be very prone
for misuse.
Not only do they not match what TickDuration uses those same
names for (it
uses them for the equivelent of total!"hours"(), etc. rather
than
get!"hours"(), etc.), which has come up a number of times
before, but what
I've found at work (where we have a C++ port of Duration) is
that pretty much
everyone keeps using get when they meant total, consistently
causing subtle
bugs. So, I've come to the conclusion that the current design
is just too
bug-prone, and by deprecating the individual getters and
renaming get to
getOnly, I hope that that will seriously reduce the risk of
misuse.
Does one really needs only one component, but not the others?
Maybe it should provide full computed broken form instead of
separate components?
auto d=dur.breakUp;
d.hours; d.minutes; d.seconds;