Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

receive writers by ref

  • Loading branch information...
commit 63bcce68db9c98581815b4f073bb85321934b4c0 1 parent 5845b5d
@9rnsr authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 io/wrapper.d
View
8 io/wrapper.d
@@ -20,7 +20,7 @@ import std.range : isInputRange, isOutputRange, put;
/**
Output $(D args) to $(D writer).
*/
-void write(Writer, T...)(Writer writer, T args)
+void write(Writer, T...)(ref Writer writer, T args)
if (isOutputRange!(Writer, dchar) && T.length > 0)
{
import std.conv;
@@ -30,20 +30,20 @@ void write(Writer, T...)(Writer writer, T args)
}
}
/// ditto
-void writef(Writer, T...)(Writer writer, T args)
+void writef(Writer, T...)(ref Writer writer, T args)
if (isOutputRange!(Writer, dchar) && T.length > 0)
{
import std.format;
formattedWrite(writer, args);
}
/// ditto
-void writeln(Writer, T...)(Writer writer, T args)
+void writeln(Writer, T...)(ref Writer writer, T args)
if (isOutputRange!(Writer, dchar))
{
write(writer, args, "\n");
}
/// ditto
-void writefln(Writer, T...)(Writer writer, T args)
+void writefln(Writer, T...)(ref Writer writer, T args)
if (isOutputRange!(Writer, dchar) && T.length > 0)
{
writef(writer, args, "\n");
Please sign in to comment.
Something went wrong with that request. Please try again.