Improve fullName template

fullName now support multi-pararmeter templates
This commit is contained in:
Mergul 2023-05-24 22:15:05 +02:00
parent 6a600d22c8
commit 1a5452d6cc
3 changed files with 43 additions and 6 deletions

View file

@ -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)))