[Issue 4427] __traits should have isFunction, isVariable, etc

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Nov 17 08:31:44 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=4427



--- Comment #8 from Rob T <alanb at ucora.com> 2012-11-17 08:31:39 PST ---
(In reply to comment #7)
> I had forgotten that I created this enhancement request, though I don't know
> how valid it is at this point given how powerful is expressions are (though how
> to fully use them isn't well enough known).
> 
> > I wasted an hour on this very issue because it's not obvious in the least how
> > to do something like isStruct() for a template constraint.
> 
> > I don't mind using is( T == struct ), so long how to do such a thing (and
> > other tests) is documented in an obvious place that someone is going to look 
> > at, like in the templates constraint section. That section currently has 
> > nothing in it of much help other than showing how to constrain a few basic 
> > types.
> 
> It's explained in the section on is expressions:
> 
> http://dlang.org/expression.html#IsExpression
> 
> However, that documentation is fairly sparse, and given the extreme flexibility
> and power (and therefore complication) of is expressions, we could really use a
> solid tutorial on them on the site. Phillippe Segaud has an extension tutorial
> on templates in general on github though:
> 
> https://github.com/PhilippeSigaud/D-templates-tutorial/blob/master/dtemplates.pdf

Thanks for the response! I have no idea how I skipped the section on
Expressions, probably because at the time I was too new with D to understand
what it was good for. lot's to read up on in there. Looks like it covers
everything I can imagine is needed.

Yes it seems that with availability of expressions the enhancement request is
somewhat redundant, and like you said, making people aware of it may be what's
needed most.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list