System.SpanTests.ReadOnlySpanTests.CtorArray1 C# (CSharp) Method

CtorArray1() private method

private CtorArray1 ( ) : void
return void
        public static void CtorArray1()
        {
            int[] a = { 91, 92, -93, 94 };
            ReadOnlySpan<int> span;

            span = new ReadOnlySpan<int>(a);
            span.Validate<int>(91, 92, -93, 94);

            span = new ReadOnlySpan<int>(a, 0);
            span.Validate<int>(91, 92, -93, 94);

            span = new ReadOnlySpan<int>(a, 0, a.Length);
            span.Validate<int>(91, 92, -93, 94);
        }