Comment #0 by destructionator — 2011-01-04T08:58:05Z
Variant a;
a = "10";
assert(a.convertsTo!(const(char)[])); // fails but should work
This breaks coercing strings to numeric types too,
since this is the test inside the coerce function.
Comment #1 by lovelydear — 2012-04-22T09:48:40Z
Also fails on 2.059 win32.
For convenience:
import std.stdio;
import std.variant, std.conv;
void main(){
Variant a;
a = "10";
assert(a.convertsTo!(const(char)[])); // fails but should work
}
Comment #2 by andrej.mitrovich — 2013-02-09T13:20:51Z
ImplicitConversionTargets in std.traits is to blame. That template is probably missing more though, for example I don't see 'wchar[] -> const(wchar)[]' anywhere.