Example
template Dummy(T) {} static assert(staticToString!(Dummy!int) == "Dummy!int"); template DummyCustom1(T) { template staticToStringImpl() { enum staticToStringImpl = T.stringof; } } static assert(staticToString!(DummyCustom1!int) == "int"); template DummyCustom2(T) { enum staticToStringImpl = T.stringof; } static assert(staticToString!(DummyCustom2!int) == "int");
Converts to string template T.
If T defines inner template (or naked enum) toString, then the member is used, otherwise T.stringof is printed.
The template is helpful while debugging. DMD generates ugly mangled names for templates after several transformations.