@@ -489,7 +489,7 @@ ref W printElement(C = char, EscapeFormat escapeFormat = EscapeFormat.ion, W, T)
489
489
/+ +
490
490
Multiargument overload.
491
491
+/
492
- ref W print (C = char , W, Args... )(scope return ref W w, scope auto ref const Args args)
492
+ ref W print (C = char , W, Args... )(scope return ref W w, scope auto ref const inout ( Args) args)
493
493
if (Args.length > 1 )
494
494
{
495
495
foreach (i, ref c; args)
@@ -500,7 +500,7 @@ ref W print(C = char, W, Args...)(scope return ref W w, scope auto ref const Arg
500
500
}
501
501
502
502
// / Prints enums
503
- ref W print (C = char , W, T)(scope return ref W w, const T c)
503
+ ref W print (C = char , W, T)(scope return ref W w, const inout (T) c)
504
504
if (is (T == enum ))
505
505
{
506
506
import mir.enums: getEnumIndex, enumStrings;
@@ -566,7 +566,7 @@ version (mir_test) unittest
566
566
567
567
// / Prints associative array
568
568
pragma (inline, false )
569
- ref W print (C = char , W, V, K)(scope return ref W w, scope const V[K ] c)
569
+ ref W print (C = char , W, V, K)(scope return ref W w, scope const inout (V)[ inout (K) ] c)
570
570
{
571
571
enum C left = ' [' ;
572
572
enum C right = ' ]' ;
@@ -600,7 +600,7 @@ version (mir_test) unittest
600
600
601
601
// / Prints array
602
602
pragma (inline, false )
603
- ref W print (C = char , W, T)(scope return ref W w, scope const (T)[] c)
603
+ ref W print (C = char , W, T)(scope return ref W w, scope const inout (T)[] c)
604
604
if (! isSomeChar! T)
605
605
{
606
606
enum C left = ' [' ;
@@ -686,15 +686,15 @@ version (mir_test) unittest
686
686
}
687
687
688
688
// / Prints some string
689
- ref W print (C = char , W)(scope return ref W w, scope const (C)[] c)
689
+ ref W print (C = char , W)(scope return ref W w, scope const inout (C)[] c)
690
690
if (isSomeChar! C)
691
691
{
692
692
w.put(c);
693
693
return w;
694
694
}
695
695
696
696
// / Prints integers
697
- ref W print (C = char , W, I)(scope return ref W w, const I c)
697
+ ref W print (C = char , W, I)(scope return ref W w, const inout (I) c)
698
698
if (isIntegral! I && ! is (I == enum ))
699
699
{
700
700
static if (I.sizeof == 16 )
@@ -714,7 +714,7 @@ ref W print(C = char, W, I)(scope return ref W w, const I c)
714
714
}
715
715
716
716
// / Prints floating point numbers
717
- ref W print (C = char , W, T)(scope return ref W w, const T c, NumericSpec spec = NumericSpec.init)
717
+ ref W print (C = char , W, T)(scope return ref W w, const inout (T) c, NumericSpec spec = NumericSpec.init)
718
718
if (is (T == float ) || is (T == double ) || is (T == real ))
719
719
{
720
720
import mir.bignum.decimal;
@@ -807,7 +807,7 @@ unittest
807
807
808
808
// / Prints structs and unions
809
809
pragma (inline, false )
810
- ref W print (C = char , W, T)(scope return ref W w, ref const T c)
810
+ ref W print (C = char , W, T)(scope return ref W w, ref const inout (T) c)
811
811
if (is (T == struct ) || is (T == union ) && ! is (T : NumericSpec))
812
812
{
813
813
static if (__traits(hasMember, T, " toString" ))
@@ -870,7 +870,7 @@ ref W print(C = char, W, T)(scope return ref W w, ref const T c)
870
870
// / ditto
871
871
// FUTURE: remove it
872
872
pragma (inline, false )
873
- ref W print (C = char , W, T)(scope return ref W w, scope const T c)
873
+ ref W print (C = char , W, T)(scope return ref W w, scope const inout (T) c)
874
874
if (is (T == struct ) || is (T == union ))
875
875
{
876
876
return print! (C, W, T)(w, c);
@@ -893,7 +893,7 @@ version (mir_test) unittest
893
893
894
894
// / Prints classes and interfaces
895
895
pragma (inline, false )
896
- ref W print (C = char , W, T)(scope return ref W w, scope const T c)
896
+ ref W print (C = char , W, T)(scope return ref W w, scope const inout (T) c)
897
897
if (is (T == class ) || is (T == interface ))
898
898
{
899
899
enum C[4 ] Null = " null" ;
0 commit comments