toImpl

private fnT toImpl(T, S)(S) if (isInputRange!S && isInfinite!S && isExactSomeString!T)
No documentation available for this declaration.
private fnT toImpl(T, S)(S value) if (is(S : T) && !isEnumStrToStr!(S, T) && !isNullToStr!(S, T))

If the source type is implicitly convertible to the target type, to simply performs the implicit conversion.

private fnT toImpl(T, S)(S value) if (isTuple!T)
No documentation available for this declaration.
private fnT toImpl(T, S)(ref S s) if (isStaticArray!S)
No documentation available for this declaration.
private fnT toImpl(T, S)(S value) if (!is(S : T) && is(typeof(S.init.opCast!T()) : T) && !isExactSomeString!T && !is(typeof(T(value))))

When source type supports member template function opCast, it is used.

private fnT toImpl(T, S)(S value) if (!is(S : T) && is(T == struct) && is(typeof(T(value))))

When target type supports 'converting construction', it is used.

  • If target type is struct, T(value) is used.
  • If target type is class, new T(value) is used.
private fnT toImpl(T, S)(S value) if (!is(S : T) && is(T == class) && is(typeof(new T(value))))

ditto

private fnT toImpl(T, S)(S value) if (!is(S : T) && (is(S == class) || is(S == interface)) && !is(typeof(value.opCast!T()) : T) && (is(T == class) || is(T == interface)) && !is(typeof(new T(value))))

Object-to-object conversions by dynamic casting throw exception when the source is non-null and the target is null.

private fnT toImpl(T, S)(S value) if (!(is(S : T) && !isEnumStrToStr!(S, T) && !isNullToStr!(S, T)) && !isInfinite!S && isExactSomeString!T)

Handles type _to string conversions

private fnT toImpl(T, S)(ref S value) if (!(is(S : T) && !isEnumStrToStr!(S, T) && !isNullToStr!(S, T)) && !isInfinite!S && isExactSomeString!T && !isCopyable!S && !isStaticArray!S)
No documentation available for this declaration.
private fnT toImpl(T, S)(S value, uint radix, LetterCase letterCase = LetterCase.upper) if (isIntegral!S && isExactSomeString!T) @trusted pure
No documentation available for this declaration.
private fnT toImpl(T, S)(S value) if (!is(S : T) && (isNumeric!S || isSomeChar!S || isBoolean!S) && (isNumeric!T || isSomeChar!T || isBoolean!T) && !is(T == enum))

Narrowing numeric-numeric conversions throw when the value does not fit in the narrower type.

private fnT toImpl(T, S)(scope S value) if (!is(S : T) && !isSomeString!S && isDynamicArray!S && !isExactSomeString!T && isArray!T)

Array-to-array conversion (except when target is a string type) converts each element in turn by using to.

private fnT toImpl(T, S)(S value) if (!is(S : T) && isAssociativeArray!S && isAssociativeArray!T && !is(T == enum))

Associative array to associative array conversion converts each key and each value in turn.

private fnT toImpl(T, S)(S value) if (isInputRange!S && isSomeChar!(ElementEncodingType!S) && !isExactSomeString!T && is(typeof(parse!T(value))) && // https://issues.dlang.org/show_bug.cgi?id=20539 !(is(T == enum) && is(typeof(value == OriginalType!T.init)) && !isSomeString!(OriginalType!T)))

String, or string-like input range, to non-string conversion runs parsing.

  • When the source is a wide string, it is first converted to a narrow

    string and then parsed.

  • When the source is a narrow string, normal text parsing occurs.
private fnT toImpl(T, S)(S value, uint radix) if (isSomeFiniteCharInputRange!S && isIntegral!T && is(typeof(parse!T(value, radix))))

ditto

private fnT toImpl(T, S)(S value) if (isSomeChar!T && !is(typeof(parse!T(value))) && is(typeof(parse!dchar(value))))

String, or string-like input range, to char type not directly supported by parse parses the first dchar of the source.

Returns

the first code point of the input range, converted

to type T.

Throws

ConvException if the input range contains more than

a single code point, or if the code point does not fit into a code unit of type T.

private fnT toImpl(T, S)(S value) if (is(T == enum) && !is(S == enum) && is(typeof(value == OriginalType!T.init)) && !isFloatingPoint!(OriginalType!T) && !isSomeString!(OriginalType!T))

Convert a value that is implicitly convertible to the enum base type into an Enum value. If the value does not match any enum member values a ConvException is thrown. Enums with floating-point or string base types are not supported.