On Monday, 8 July 2019 at 12:53:18 UTC, Digital Mars wrote:
I guess that there is no way to have `writeln` automatically use the output range overload instead of allocating one. You need somehow to provide the output range to `toISOExtString` explicitly because `writeln` outputs the return of `toISOExtString` and have no ability to use specific overload. That is compiler calls `toISOExtString` and then passes its return to `writeln`. Probably library solution isn't possible in this case. Workaround is using own wrapper to provide output range to `toISOExtString`.

This is pretty much what I'd concluded myself, but I wanted to check to make sure there wasn't some clever option I didn't know about. A helper function with wrapper struct seems the obvious way forward.

Reply via email to