Struct Vec

struct Vec(T, ulong N)
  
if (N > 0 && isNumeric!T);

Constructors

NameDescription
this (comps) Build a vector from its components Can be called with any combination of scalar or vectors, as long as the total number of scalar fit with length
this (arr) Build a vector from an array.
this (comp) Build a vector with all components assigned to one value

Fields

NameTypeDescription
_rep T[N]

Properties

NameTypeDescription
array[get] T[length]All components in a static array
data[get] inout(T)[]Return the data of the array
opDispatch[get] TAccess the component by name.
opDispatch[set] TAssign the component by name.
opDispatch[get] autoAccess the components by swizzling.
opDispatch[set] Vec!(U,num)Assign the components by swizzling.
tup[get] Tuple!CompSeqAll components in a tuple

Methods

NameDescription
correctSlice (slice)
opApply (dg) Foreach support.
opBinary (oth) Perform a term by term operation on the vector.
opBinary (val) Perform a scalar operation on the vector.
opBinaryRight (val) Perform a scalar operation on the vector.
opCast () Cast the vector to another type of component
opDollar () End of the vector.
opIndex (index) Index a vector component.
opIndex (slice) Slicing support
opIndexAssign (val, index) Assign a vector component.
opIndexAssign (val, slice) Slicing support
opIndexOpAssign (val, index) Assign a vector component.
opIndexOpAssign (val, slice) Slicing support
opIndexOpAssign (val, slice) Term by term sliced assignement operation.
opOpAssign (oth) Perform a term by term assignment operation on the vector.
opOpAssign (val) Perform a scalar assignment operation on the vector.
opSlice (start, end) Slicing support
opUnary () Unary "+" operation.
opUnary () Unary "-" operation.
toString ()

Aliases

NameDescription
Component The type of a vector component
CompSeq Alias to a type sequence holding all components