On Sun, Jan 15, 2012 at 22:19, Timon Gehr <timon.g...@gmx.ch> wrote: Nick: >> Goddamnnit, what the fuck is wrong with me? Yes that works :) > > I suspect a better error message would have prevented this. > DMD still has some potential of improvement in that area. =)
In that case, to!(Origin, Target) could be extended to deal with to!(Origin, <empty there>). It's been a long time since I last looked at std.conv.to, but maybe: template to(T) { T to(A...)(A args) { static if (A.length) return toImpl!T(args); else static assert(false, "Trying to use to!("~T.stringof~") with no argument. What were you trying to do?"); } }