(git HEAD) std.datetime spewing deprecation messages
Byron Heads via Digitalmars-d
digitalmars-d at puremagic.com
Thu Jun 5 07:35:16 PDT 2014
On Thu, 05 Jun 2014 07:18:59 -0700, H. S. Teoh via Digitalmars-d wrote:
> On Thu, Jun 05, 2014 at 01:23:47AM -0700, Jonathan M Davis via
> Digitalmars-d wrote:
>>
>> {
>> auto d = dur!"days"(12) + dur!"minutes"(7) + dur!"usecs"(501223);
>> long days;
>> int seconds;
>> short msecs;
>> d.split!("days", "seconds", "msecs")(&days, &seconds, &msecs);
>> assert(days == 12);
>> assert(seconds == 7 * 60);
>> assert(msecs == 501);
> [...]
>
> Very nice! I like this. It looks very D-ish, and very idiomatic.
if only we could avoid the quotes, would a enum array work?
d.split![days, second, msecs](...)
More information about the Digitalmars-d
mailing list