On Sun, 06 Feb 2011 10:25:15 -0500, Andrei Alexandrescu
<seewebsiteforem...@erdani.org> wrote:
How does the stream decide between 1 and 2? Clearly it's undesirable to
grow the buffer too much and it's also undesirable to copy too much
data. A simple approach is to establish a bound on losses, for example
copy data only if size to copy is < 5% of the entire buffer.
I think also, you should test to see if appending will copy the data
anyways (i.e. reallocate). We may need to add a runtime function for this.
-Steve