Is it possible to append to a local buffer without reallocating?

tipdbmp email at example.com
Thu Jan 11 17:41:33 UTC 2018


> Appender is able to do this:

It seems that Appender allocates its own private data:

private struct Data
{
     size_t capacity;
     Unqual!T[] arr;
     bool canExtend = false;
}
...
private Data* _data;
...
_data = new Data;

But hopefully its bug free unlike what I posted (missing 
`T.sizeof *` in the memcpy call).




More information about the Digitalmars-d-learn mailing list