There was an error while loading. Please reload this page.
1 parent 7a57bc8 commit 59c6c3dCopy full SHA for 59c6c3d
source/mir/appender.d
@@ -245,6 +245,9 @@ struct ScopedBuffer(T, size_t bytes = 4096)
245
}
246
247
248
+ ///
249
+ alias opOpAssign(string op : "~") = put;
250
+
251
///
252
void reset() scope nothrow
253
{
@@ -326,6 +329,18 @@ version (mir_test) unittest
326
329
assert(buf.data == "cs");
327
330
328
331
332
+@safe pure nothrow @nogc
333
+version (mir_test) unittest
334
+{
335
+ auto buf = scopedBuffer!(char, 3);
336
+ buf ~= 'c';
337
+ buf ~= "str";
338
+ assert(buf.data == "cstr");
339
340
+ buf.popBackN(2);
341
+ assert(buf.data == "cs");
342
+}
343
344
345
struct UnsafeArrayBuffer(T)
346
0 commit comments