to

If the source type From and the target type To are equal, does nothing. If From can be implicitly converted to To, just returns from.

Members

Functions

to
To to(From from)

Parameters

To

Target type.

Return Value

from.

Examples

auto val = 5.to!int();
assert(val == 5);
static assert(is(typeof(val) == int));

Meta