Casts value v to type T.
int i = cast(int)(foo * bar); int i = castTo!int(foo * bar); int j = cast(int) round(floatValue); int j = round(floatValue).castTo!int; int k = cast(int) floatValue + foobar; int k = floatValue.castTo!int + foobar; auto m = Point( cast(int) calc(a.x, b.x), cast(int) calc(a.y, b.y), ); auto m = Point( calc(a.x, b.x).castTo!int, calc(a.y, b.y).castTo!int, );
See Implementation
Added on April 24, 2024. Renamed from typeCast to castTo on May 24, 2024.
Casts value v to type T.