Improve fullName template
fullName now support multi-pararmeter templates
This commit is contained in:
parent
6a600d22c8
commit
1a5452d6cc
3 changed files with 43 additions and 6 deletions
|
|
@ -69,6 +69,17 @@ template fullName(alias T : X!A, alias X, A...)
|
|||
enum fullName = fullName!parent ~ '.' ~ __traits(identifier, X) ~ "!(" ~ fullName!A ~ ")";
|
||||
}
|
||||
|
||||
template fullName(T...)
|
||||
{
|
||||
static if(__traits(compiles, __traits(parent, T[0])))
|
||||
{
|
||||
alias parent = __traits(parent, T[0]);
|
||||
enum fullName = fullName!parent ~ '.' ~ __traits(identifier, T[0]) ~ ", " ~ fullName!(T[1 .. $]);
|
||||
}
|
||||
else static if(__traits(compiles, __traits(identifier, T[0])))enum fullName = __traits(identifier, T[0]) ~ ", " ~ fullName!(T[1 .. $]);
|
||||
else enum fullName = T[0].stringof ~ ", " ~ fullName!(T[1 .. $]);
|
||||
}
|
||||
|
||||
template fullName(alias T)
|
||||
{
|
||||
static if(__traits(compiles, __traits(parent, T)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue