Exemple #1
0
        static void Field()
        {
            ReadonlyField.Increment();
            ReadonlyField.Increment();
            MutableField.Increment();
            MutableField.Increment();
            // Ensure that 'v' isn't incorrectly removed
            // as a compiler-generated temporary
            MutValueType v = MutableField;

            v.Increment();
            Console.WriteLine("Final value in MutableField: " + MutableField.val);
        }
Exemple #2
0
 static void ValueParameter(MutValueType m)
 {
     m.Increment();
     m.Increment();
 }
Exemple #3
0
 static void RefParameter(ref MutValueType m)
 {
     m.Increment();
     m.Increment();
 }