[Issue 16062] New: Add 'clear' method to OutBuffer (std.outbuffer)
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sun May 22 20:01:57 PDT 2016
https://issues.dlang.org/show_bug.cgi?id=16062
Issue ID: 16062
Summary: Add 'clear' method to OutBuffer (std.outbuffer)
Product: D
Version: D2
Hardware: x86
OS: Mac OS X
Status: NEW
Severity: enhancement
Priority: P1
Component: phobos
Assignee: nobody at puremagic.com
Reporter: jrdemail2000-dlang at yahoo.com
Enhancement request: Add an API to OutBuffer (std.outbuffer) to clear the data
in an OutBuffer. The intent is to reuse the OutBuffer, but without reallocating
the memory for the internally managed buffer. This would be similar to
std.array.appender.clear method.
It appear that this could be done by setting the 'offset' member of the
OutBuffer to zero. If this works correctly, a clear API could be exposed that
implements this.
A forum thread on this topic:
https://forum.dlang.org/thread/bbjgfradpwqaelaruorl@forum.dlang.org
--
More information about the Digitalmars-d-bugs
mailing list