arrayOutputRange

return output range with reference to array

arrayOutputRange
(
A
)
(
ref A arr
)
if (
isArray!A ||
isStaticArray!A
)

Examples

1 int[13] arr1;
2 auto rng1 = arrayOutputRange( arr1 );
3 fillFlat!int( rng1, [1,2], 3, [[4,5],[6]], iota(7,9), [[[9],[10,11]],[[12]]] );
4 assertEq( arr1, [1,2,3,4,5,6,7,8,9,10,11,12,0] );
5 
6 int[] arr2 = new int[]( 13 ) ;
7 auto rng2 = arrayOutputRange( arr2 );
8 fillFlat!int( rng2, [1,2], 3, [[4,5],[6]], iota(7,9), [[[9],[10,11]],[[12]]] );
9 assertEq( arr2, [1,2,3,4,5,6,7,8,9,10,11,12,0] );

Meta