Ensuring template argument is descendant of class

Adam D. Ruppe destructionator at gmail.com
Thu Dec 12 14:23:15 PST 2013


On Thursday, 12 December 2013 at 22:05:17 UTC, Ross Hays wrote:
> http://dlang.org/expression.html#IsExpression and had no idea 
> is could be used with that syntax. The more D I learn the more 
> counter-intuitive I find some aspects of the language syntax.

Yeah, the is expression is one of the strangest things in D. 
Especially if you use it to deconstruct arrays and templates! But 
between the two simpler forms of is(A == B) and is(A : B), and 
http://dlang.org/phobos/std_traits.html you can get a lot done 
and it isn't so bad looking.


More information about the Digitalmars-d-learn mailing list