The Appender to zero out.
(Optional) Whether to also call the .clear() method of the Appender sink.
(Optional) The value to zero out the contents with.
{ Appender!(char[]) sink; sink.put('a'); sink.put('b'); sink.put('c'); assert(sink.data == ['a', 'b', 'c']); sink.zero(clear: false); assert(sink.data == [ 255, 255, 255 ]); sink.put('d'); assert(sink.data == [ 255, 255, 255, 'd' ]); sink.zero(clear: false, 'X'); assert(sink.data == [ 'X', 'X', 'X', 'X' ]); sink.zero(clear: true); assert(!sink.data.length); } { Appender!(string[]) sink; sink.put("abc"); sink.put("def"); sink.put("ghi"); assert(sink.data == [ "abc", "def", "ghi" ]); sink.zero(clear: false, "(empty)"); assert(sink.data == [ "(empty)", "(empty)", "(empty)" ]); sink.zero(clear: false); assert(sink.data == [ string.init, string.init, string.init ]); sink.zero(clear: true); assert(!sink.data.length); }
Zeroes out the contents of an Appender.