How do I convert a type to a string?
I thought something like this should work
import std.stdio: writeln;
import std.conv: to;
writeln(to!string(int));
Update: I found it at http://dlang.org/phobos/std_traits.html#.fullyQualifiedName
I guess all logic in D operating on types are given as templates arguments right?
int
is already a type. You don't need to typeof
it.
You could use the .stringof
property to get a string representation. http://ideone.com/T4yYmo
writeln(int.stringof);