On 1/27/20 1:12 PM, Steven Schveighoffer wrote:

void writeln(Pipe)(ref Pipe sink, string text)
{
   enforce(sink.ensureElems(text.size) >= text.length); // make sure there's enough buffer space to hold the text
    sink[0 .. text.length] = text; // write to the buffer
    sink.release(text.length); // release to be written
}


Ugh, should have tested.

sink.window[0 .. text.length] = text;

-Steve

Reply via email to