Bug 16062 – Add 'clear' method to OutBuffer (std.outbuffer)
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Mac OS X
Creation time
2016-05-23T03:01:57Z
Last change time
2018-01-05T13:30:13Z
Assigned to
No Owner
Creator
Jon Degenhardt
Comments
Comment #0 by jrdemail2000-dlang — 2016-05-23T03:01:57Z
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/[email protected]