aarti_pl wrote:
Walter Bright pisze:
aarti_pl wrote:
How would you do currently in D?

template (T) if (T.init + T.init)
{
}

in D1.0

template(T if typeof(T.init + T.init) == T)

D1 is closed to such enhancements, in any case, the ==T part is wrong. byte+byte==int, for example.


or in D2.0

template(T if __traits(compiles, T.init + T.init))

I could mess something in above examples, but as you can see, getting it to work is not a problem of my syntax for templates.

Ok, but it's hard to see why it is better.

Reply via email to