コード例 #1
0
        public void readonly_span()
        {
            ReadOnlySpan <int> values = stackalloc int[] {
                1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
                11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
                21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
            };

            Assert.True(values.Any());
        }
コード例 #2
0
        public void readonly_span_empty()
        {
            ReadOnlySpan <int> values = stackalloc int[0];

            Assert.False(values.Any());
        }