@@ -1746,12 +1746,12 @@ FormatSpec!Char singleSpec(Char)(Char[] fmt)
1746
1746
*
1747
1747
* Params:
1748
1748
* w = The $(REF_ALTTEXT output _range, isOutputRange, std,_range,primitives) to write to.
1749
- * obj = The value to write.
1749
+ * val = The value to write.
1750
1750
* f = The $(REF FormatSpec, std, format) defining how to write the value.
1751
1751
*/
1752
- void formatValue (Writer , T, Char)(auto ref Writer w, auto ref T obj , const ref FormatSpec! Char f)
1752
+ void formatValue (Writer , T, Char)(auto ref Writer w, auto ref T val , const ref FormatSpec! Char f)
1753
1753
{
1754
- formatValueImpl(w, obj , f);
1754
+ formatValueImpl(w, val , f);
1755
1755
}
1756
1756
1757
1757
/+ +
@@ -1861,8 +1861,10 @@ void formatValue(Writer, T, Char)(auto ref Writer w, auto ref T obj, const ref F
1861
1861
* Dynamic arrays are formatted as input ranges.
1862
1862
*
1863
1863
* Specializations:
1864
- * $(UL $(LI $(D void[]) is formatted like $(D ubyte[]).)
1865
- * $(LI Const array is converted to input range by removing its qualifier.))
1864
+ * $(UL
1865
+ * $(LI $(D void[]) is formatted like $(D ubyte[]).)
1866
+ * $(LI Const array is converted to input range by removing its qualifier.)
1867
+ * )
1866
1868
*/
1867
1869
@safe pure unittest
1868
1870
{
@@ -1911,8 +1913,6 @@ void formatValue(Writer, T, Char)(auto ref Writer w, auto ref T obj, const ref F
1911
1913
*/
1912
1914
@system unittest
1913
1915
{
1914
- import std.format ;
1915
-
1916
1916
struct Point
1917
1917
{
1918
1918
int x, y;
@@ -1972,7 +1972,7 @@ void formatValue(Writer, T, Char)(auto ref Writer w, auto ref T obj, const ref F
1972
1972
}
1973
1973
1974
1974
// / Delegates are formatted by `ReturnType delegate(Parameters) FunctionAttributes`
1975
- @safe pure unittest
1975
+ @safe unittest
1976
1976
{
1977
1977
import std.conv : to;
1978
1978
@@ -1985,11 +1985,13 @@ void formatValue(Writer, T, Char)(auto ref Writer w, auto ref T obj, const ref F
1985
1985
1986
1986
@system int delegate (short ) @nogc bar() nothrow pure
1987
1987
{
1988
- int * p = new int ;
1988
+ int * p = new int (1 );
1989
+ i = * p;
1989
1990
return &foo;
1990
1991
}
1991
1992
1992
1993
assert (to! string (&bar) == " int delegate(short) @nogc delegate() pure nothrow @system" );
1994
+ assert (() @trusted { return bar()(3 ); }() == 4 );
1993
1995
}
1994
1996
1995
1997
/*
@@ -5942,7 +5944,6 @@ char[] sformat(Char, Args...)(char[] buf, in Char[] fmt, Args args)
5942
5944
@system unittest
5943
5945
{
5944
5946
import core.exception ;
5945
- import std.format ;
5946
5947
5947
5948
debug (string ) trustedPrintf(" std.string.sformat.unittest\n " );
5948
5949
0 commit comments