Constructs an Appender with a given array. Note that this does not copy the data. If the array has a larger capacity as determined by arr.capacity, it will be used by the appender. After initializing an appender on an array, appending to the original array will reallocate.
Appends to the managed array.
Clears the managed array. This allows the elements of the array to be reused for appending.
Appends item to the managed array. Performs encoding for char types if A is a differently typed char array.
Appends an entire range to the managed array. Performs encoding for char elements if A is a differently typed char array.
Reserve at least newCapacity elements for appending. Note that more elements may be reserved than requested. If newCapacity <= capacity, then nothing is done.
Shrinks the managed array to the given length.
Gives a string in the form of Appender!(A)(data).
Use opSlice() from now on.
A general handler for format strings.
the array type to simulate.
auto app = appender!string(); string b = "abcdefg"; foreach (char c; b) app.put(c); assert(app[] == "abcdefg"); int[] a = [ 1, 2 ]; auto app2 = appender(a); app2.put(3); app2.put([ 4, 5, 6 ]); assert(app2[] == [ 1, 2, 3, 4, 5, 6 ]);
Implements an output range that appends data to an array. This is recommended over array ~= data when appending many elements because it is more efficient. Appender maintains its own array metadata locally, so it can avoid the performance hit of looking up slice capacity for each append.