scopedBuffer

  1. struct ScopedBuffer(T, size_t bytes = 4096)
  2. auto scopedBuffer()
    @trusted
    scopedBuffer
    (
    T
    size_t bytes = 4096
    )
    ()

Examples

auto buf = scopedBuffer!char;
buf.put('c');
buf.put("str");
assert(buf.data == "cstr");

buf.popBackN(2);
assert(buf.data == "cs");

immutable

auto buf = scopedBuffer!(immutable char);
buf.put('c');
buf.put("str");
assert(buf.data == "cstr");

buf.popBackN(2);
assert(buf.data == "cs");

Meta