In order to make this work
import std.typecons;
alias vstring = Typedef!string;
void main ()
{
import std.stdio;
import std.conv;
auto v = 3.to!vstring; // ain't work out of the box
writeln (v);
auto w = 3.to!string;
writeln (w);
long l = 3.to!long;
writeln (l);
}
I ended up adding
V to (V, T) (T t)
{
static import std.conv;
return std.conv.to!V (t);
}
V to (V : vstring, T) (T t)
{
static import std.conv;
auto s = std.conv.to!(TypedefType!V) (t);
return cast (V) s;
}
to the code. Is there a way to add only a partial specialization of std.conv.to?