On Wednesday, 11 June 2014 at 21:06:42 UTC, Kapps wrote:
On Wednesday, 11 June 2014 at 20:59:25 UTC, Nordlöw wrote:
Can somebody explain the meaning of split in the error message

Deprecation: function core.time.Duration.weeks is deprecated - Please use split instead. weeks was too frequently confused for total!"weeks".

given by function

shortDurationString()

at

https://github.com/nordlow/justd/blob/master/pprint.d

https://github.com/D-Programming-Language/druntime/pull/825

Ok, I replaced

    immutable weeks = dur.weeks();

with

    immutable weeks = dur.split!"weeks";

but my code using it

    if (weeks)
    {
        if (weeks < 52)

fails as

pprint.d(39,9): Error: expression weeks of type immutable(SplitUnits) does not have a boolean value pprint.d(41,13): Error: incompatible types for ((weeks) < (52)): 'immutable(SplitUnits)' and 'int'

Sorry but I don't understand what to do with the struct SplitUnits.

Reply via email to