mirror of
https://github.com/dlang/phobos.git
synced 2025-04-30 07:00:37 +03:00
Fix Issue 16991 - Make writeln documentation palatable
This commit is contained in:
parent
1951dec16b
commit
d7f6cc337e
1 changed files with 19 additions and 2 deletions
21
std/stdio.d
21
std/stdio.d
|
@ -3374,8 +3374,8 @@ private @property File trustedStdout() @trusted
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************
|
/***********************************
|
||||||
For each argument $(D arg) in $(D args), format the argument (as per
|
For each argument $(D arg) in $(D args), format the argument (using
|
||||||
$(LINK2 std_conv.html, to!(string)(arg))) and write the resulting
|
$(REF to, std,conv)) and write the resulting
|
||||||
string to $(D args[0]). A call without any arguments will fail to
|
string to $(D args[0]). A call without any arguments will fail to
|
||||||
compile.
|
compile.
|
||||||
|
|
||||||
|
@ -3383,6 +3383,23 @@ Params:
|
||||||
args = the items to write to `stdout`
|
args = the items to write to `stdout`
|
||||||
|
|
||||||
Throws: In case of an I/O error, throws an $(D StdioException).
|
Throws: In case of an I/O error, throws an $(D StdioException).
|
||||||
|
|
||||||
|
Example:
|
||||||
|
Reads `stdin` and writes it to `stdout` with an argument
|
||||||
|
counter.
|
||||||
|
---
|
||||||
|
import std.stdio;
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
string line;
|
||||||
|
|
||||||
|
for (size_t count = 0; (line = readln) !is null; count++)
|
||||||
|
{
|
||||||
|
write("Input ", count, ": ", line, "\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
---
|
||||||
*/
|
*/
|
||||||
void write(T...)(T args) if (!is(T[0] : File))
|
void write(T...)(T args) if (!is(T[0] : File))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue