isImplicitlyConvertible

Checks whether From is implicitly (without explicit $(D_KEYWORD cast)) to To.

enum bool isImplicitlyConvertible(From, To);

Return Value

$(D_KEYWORD true) if From is implicitly convertible to To, $(D_KEYWORD false) if not.

Examples

static assert(isImplicitlyConvertible!(const(byte), byte));
static assert(isImplicitlyConvertible!(byte, char));
static assert(isImplicitlyConvertible!(byte, short));
static assert(!isImplicitlyConvertible!(short, byte));
static assert(isImplicitlyConvertible!(string, const(char)[]));

Meta