[Issue 10828] datetime toString functions should accept sink

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Apr 8 10:07:04 PDT 2014


https://d.puremagic.com/issues/show_bug.cgi?id=10828



--- Comment #2 from monarchdodra at gmail.com 2014-04-08 10:06:58 PDT ---
(In reply to comment #1)
> The problem will move on to the checks of the format specifiers, which want to
> throw exceptions, which means the GC could in turn throw
> InvalidMemoryOperationError.

An exception is only thrown if the format string is invalid. Furthermore, there
*is* a toString which simply does not take format. So *that* should never throw
(though it might not actually be nothrow, due to UTF).

Besides, GC and destructors is only one aspect of the issue. Having a
`toString` that takes a sink is just good design overall. Avoids gratuitous
allocations.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list