Vec.opBinary

Implements the basic binary operators between a vector and a scalar value. It supports element-wise addition, subtraction multiplication, and division.

  1. Vec!(T, size) opBinary(Vec!(V, size) other)
  2. Vec!(T, size) opBinary(V scalar)
    struct Vec(T, size_t size)
    const @nogc
    Vec!(T, size)
    opBinary
    (
    string op
    V
    )
    ()
    if (
    isNumeric!V
    )
    if (
    isNumeric!T &&
    size > 0
    )

Parameters

scalar V

The scalar value to apply to each element of the vector.

Return Value

Type: Vec!(T, size)

A new vector that is the result of applying the scalar value to this vector's elements, using the given operation.

Meta