We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3f990a7 commit 2f78a41Copy full SHA for 2f78a41
std/conv.d
@@ -1013,7 +1013,17 @@ if (!(is(S : T) &&
1013
!isEnumStrToStr!(S, T) && !isNullToStr!(S, T)) &&
1014
!isInfinite!S && isExactSomeString!T)
1015
{
1016
- static if (isExactSomeString!S && value[0].sizeof == ElementEncodingType!T.sizeof)
+ static if (is(typeof(T.init.toString())) && __traits(compiles, T.init.toString()) &&
1017
+ isSomeString!(typeof(T.init.toString())))
1018
+ {
1019
+
1020
+ auto toImpl(T value)
1021
1022
+ return value.toString();
1023
+ }
1024
1025
1026
+ else static if (isExactSomeString!S && value[0].sizeof == ElementEncodingType!T.sizeof)
1027
1028
// string-to-string with incompatible qualifier conversion
1029
static if (is(ElementEncodingType!T == immutable))
0 commit comments