The OpenD Programming Language

appender

Convenience function that returns an Appender instance, optionally initialized with array.

Examples

auto w = appender!string;
// pre-allocate space for at least 10 elements (this avoids costly reallocations)
w.reserve(10);
assert(w.capacity >= 10);

w.put('a'); // single elements
w.put("bc"); // multiple elements

// use the append syntax
w ~= 'd';
w ~= "ef";

assert(w[] == "abcdef");

Meta