Fun with templates

Dicebot public at dicebot.lv
Sat Jul 6 08:10:24 PDT 2013


On Saturday, 6 July 2013 at 15:05:51 UTC, Artur Skawina wrote:
> ...

It is not that simple. Consider:

void f(T)(T t)
{
     static if (T == Unqual!T)
     // one function body
     else
     // completely different one
}

Currently every template instance is completely independent and 
tied to exact type. I don't know of any tool to express "group of 
related types" concept in D other than built-in "inout".


More information about the Digitalmars-d mailing list