Fun with templates

Marco Leise Marco.Leise at gmx.de
Sun Jul 7 04:32:33 PDT 2013


Am Sat, 06 Jul 2013 17:10:24 +0200
schrieb "Dicebot" <public at dicebot.lv>:

> 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".

Hmm, this inout stuff sounds like a possible solution...

-- 
Marco



More information about the Digitalmars-d mailing list