traits has "Unqual", which can give the Unqualified type of something. However, there is no guarantee that "T : Unqual!T".
For types where "T : Unqual!T", I'd like a template called "Ifti" that returns Unqual!T, and T otherwise.
This would, in particular, be useful for templates that operate on ranges.
For example:
strut S
{
int i;
}
strut P
{
int* p;
}
Ifti!(const(int[])) => const(int)[]
Ifti!(const(S)) => S
Ifti!(const(P)) => const(P)
Not sure "Ifti" is the correct name, but I couldn't think of better.
Comment #1 by peter.alexander.au — 2014-01-25T10:40:30Z