Cast to a Vector-like struct.
immutable Vec2 five = 5; OtherVec2 otherFive = cast(OtherVec2) five; assert(otherFive == OtherVec2(5, 5)); assert(!__traits(compiles, { auto v = cast(NotAVec2) five; }));
See Implementation
Cast to a Vector-like struct.