Using output-range overloads of SysTime.toISO{Ext}String with formatting code

Joseph Rushton Wakeling joseph.wakeling at webdrake.net
Sun Jul 7 14:49:31 UTC 2019


Hello folks,

Is there an idiomatic/intended way to use the output-range taking 
overloads of SysTime.toISOString and toISOExtString with stuff 
like `writeln` and `format`, as opposed to explicitly generating 
an output range to stdout or a string, and passing that to these 
methods?

I'm a bit unfamiliar with exactly all the ins and outs of the 
more recent output-range-based formatting design, but what I'm 
interested in whether it's possible to do something like 
`writefln!"%s"(now.toISOExtString)` and have it automatically use 
the output range overload rather than allocating a new string 
instance.

If that exact syntax doesn't work, is there anything almost as 
convenient?

Thanks & best wishes,

      -- Joe


More information about the Digitalmars-d-learn mailing list