Пример #1
0
        public static TypedPointer GetPointer <T1>(ref ValueTuple <T1> v, int index)
        {
            switch (index)
            {
            case 0: return(TypedPointer.Create(ref v.Item1));

            default: throw new IndexOutOfRangeException();
            }
        }
Пример #2
0
        public static TypedPointer GetPointer <T1, T2, T3, T4, T5>(ref ValueTuple <T1, T2, T3, T4, T5> v, int index)
        {
            switch (index)
            {
            case 0: return(TypedPointer.Create(ref v.Item1));

            case 1: return(TypedPointer.Create(ref v.Item2));

            case 2: return(TypedPointer.Create(ref v.Item3));

            case 3: return(TypedPointer.Create(ref v.Item4));

            case 4: return(TypedPointer.Create(ref v.Item5));

            default: throw new IndexOutOfRangeException();
            }
        }