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: nob...@puremagic.com
          Reporter: jrdemail2000-dl...@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/bbjgfradpwqaelaru...@forum.dlang.org

--

Reply via email to