Vec.opCast

Implements explicit casting between vector types. You may cast to a type with a different T element type, or a different size, or both. Casting to a different element type will call a normal cast(newType) oldValue for each value. When casting to a smaller vector size, extra elements will be truncated, and when casting to a larger size, missing elements are initialized to zero.

Keep in mind that casting floating-point vectors to integer vectors is possible, and that casting in general can lead to a loss of data.

struct Vec(T, size_t size)
const @nogc
NewVecType
opCast
(
NewVecType : Vec!(newType, newSize)
newType
size_t newSize
)
()
if (
isNumeric!T &&
size > 0
)

Return Value

Type: NewVecType

The resulting vector of the new type.

Meta