MultidimArray.opSliceAssign

Implements elements initialisation with a value, where value can be of type T or an input range which front can be assigned to an element. The range should contain exectly elements elements, otherwise an Exception will be thrown.

  1. MultidimArray opSliceAssign(T value)
    struct MultidimArray(T, size_t n)
    static if(isAssignable!T)
    opSliceAssign
    ()
    if (
    n >= 1
    )
  2. MultidimArray opSliceAssign(Range value)
  3. MultidimArray opSliceAssign(MultidimArray!(U, n) value)

Return Value

If value is of type T or a forward range, returns value. Otherwise (value is an input range but not a forward range) returns void.

Examples

auto a23 = multidimArray!int(2, 3);
auto a46 = multidimArray!int(4, 6);
auto a234 = multidimArray!int(2, 3, 4);

a23[] = a234[] = 7;
a23[] = take(a46[] = a234[] = iota(24), 6);

Meta