StringOf

Returns a stringof another template with it's real and non-mangled types

You may also customize the format in the case of templates:

struct S(T, U) {}
StringOf!(S!(int, int)).writeln; // "S!(int, int)"
StringOf!(S!(int, int), "...", "<", ">").writeln; // "S<int...int>"

Members

Aliases

AddCommas
alias AddCommas(U...) = AliasSeq!(U, sep)
Undocumented in source.
ArgNames
alias ArgNames = staticMap!(.StringOf, Args)
Undocumented in source.
Args
alias Args = TemplateArgsOf!U
Undocumented in source.
SeparatedArgNames
alias SeparatedArgNames = AliasSeq!()
Undocumented in source.
SeparatedArgNames
alias SeparatedArgNames = staticMap!(AddCommas, ArgNames)[0..$ - 1]
Undocumented in source.
Tmp
alias Tmp = TemplateOf!U
Undocumented in source.

Manifest constants

tmpFullName
enum tmpFullName;
Undocumented in source.
tmpName
enum tmpName;
Undocumented in source.

Variables

StringOf
auto StringOf;
Undocumented in source.
StringOf
auto StringOf;
Undocumented in source.
StringOf
auto StringOf;
Undocumented in source.

Parameters

sep

in case of a template, what's the deperator between types

beg

in case of a template, what token marks the beginnig of the template arguments

end

in case of a template, what token marks the end of the template arguments

Examples

template A(T...) {}
struct B {}
struct C {}
alias T = A!(A!(B, C));
assert(StringOf!T == "A!(A!(B, C))");

struct S(T) {}
assert(StringOf!(S!int) == "S!(int)");
assert(StringOf!(A!(A!(B, S!int))) == "A!(A!(B, S!(int)))");

assert(StringOf!int == "int");
assert(StringOf!3 == "3");

void f(int a, int b) {}
import std.algorithm: canFind;
assert(StringOf!(f).canFind("void(int a, int b)"));

assert(StringOf!void == "void");

See Also

Meta