std.conv.to_impl - multiple declarations
- Function toImpl
- Function toImpl
- Function toImpl
- Function toImpl
- Function toImpl
- Function toImpl
- Function toImpl
- Function toImpl
- Function toImpl
- Function toImpl
Function toImpl
If the source type is implicitly convertible to the target type, simply performs the implicit conversion.
to
Prototype
T toImpl(T, S)( S value ) if (isImplicitlyConvertible!(S, T) && !isEnumStrToStr!(S, T) && !isNullToStr!(S, T));
Function toImpl
When source type supports member template function opCast, it is used.
Prototype
T toImpl(T, S)( S value ) if (!isImplicitlyConvertible!(S, T) && is(typeof(S.init.opCast!T()) : T) && !isExactSomeString!T && !is(typeof(T(value))));
Function toImpl
When target type supports 'converting construction', it is used.
Prototypes
T toImpl(T, S)( S value ) if (!isImplicitlyConvertible!(S, T) && is(T == struct) && is(typeof(T(value)))); T toImpl(T, S)( S value ) if (!isImplicitlyConvertible!(S, T) && is(T == class) && is(typeof(new T(value))));
Function toImpl
Object-to-object conversions by dynamic casting throw exception when the source is
non-null and the target is null.
Prototype
T toImpl(T, S)( S value ) if (!isImplicitlyConvertible!(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))));
Function toImpl
Narrowing numeric-numeric conversions throw when the value does not
fit in the narrower type.
Prototype
T toImpl(T, S)( S value ) if (!isImplicitlyConvertible!(S, T) && (isNumeric!S || isSomeChar!S || isBoolean!S) && (isNumeric!T || isSomeChar!T || isBoolean!T) && !is(T == enum));
Function toImpl
Array-to-array conversion (except when target is a string type)
converts each element in turn by using .
to
Prototype
T toImpl(T, S)( S value ) if (!isImplicitlyConvertible!(S, T) && !isSomeString!S && isDynamicArray!S && !isExactSomeString!T && isArray!T);
Function toImpl
Stringize conversion from all types is supported.
- String to string conversion works for any two string types having
(
char,wchar,dchar) character widths and any combination of qualifiers (mutable,const, orimmutable). - Converts array (other than strings)
tostring. Each element is converted by calling.to!T - Associative array
tostring conversion. Each element is printed by calling.to!T - Object
tostring conversion callstoStringagainst theobjector returns"null"if theobjectis null. - Struct
tostring conversion callstoStringagainst the struct if it is defined. - For structs that do not define
toString, the conversiontostring produces the list of fields. - Enumerated types are converted
tostrings as their symbolic names. - Boolean values are printed as
"true"or"false". char,wchar,dchartoa string type.- Unsigned or
signedintegerstostrings. - All floating point types
toall string types. - Pointer
tostring conversions prints the pointer as asize_tvalue. If pointer ischar*, treat it as C-style strings. In that case, this function is@system.
Prototypes
T toImpl(T, S)( S value ) if (!(isImplicitlyConvertible!(S, T) && !isEnumStrToStr!(S, T) && !isNullToStr!(S, T)) && !isInfinite!S && isExactSomeString!T); T toImpl(T, S)( S value, uint radix, LetterCase letterCase = LetterCase.upper ) pure @trusted if (isIntegral!S && isExactSomeString!T);
Function toImpl
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.
Prototype
T toImpl(T, S)( S value ) if (is(T == enum) && !is(S == enum) && is(typeof(value == OriginalType!T.init)) && !isFloatingPoint!(OriginalType!T) && !isSomeString!(OriginalType!T));
Function toImpl
String to non-string conversion runs parsing.
- When the source is a wide string, it is first converted
toa narrow string and then parsed. - When the source is a narrow string, normal
textparsing occurs.
Prototypes
T toImpl(T, S)( S value ) if (isExactSomeString!S && isDynamicArray!S && !isExactSomeString!T && is(typeof(parse!T(value)))); T toImpl(T, S)( S value, uint radix ) if (isExactSomeString!S && isDynamicArray!S && !isExactSomeString!T && is(typeof(parse!T(value, radix))));
Function toImpl
Associative array to associative array conversion converts each key
and each value in turn.
Prototype
T toImpl(T, S)( S value ) if (isAssociativeArray!S && isAssociativeArray!T && !is(T == enum));
Authors
Walter Bright, Andrei Alexandrescu, Shin Fujishiro, Adam D. Ruppe, Kenji Hara