On 05/11/12 20:38, Mehrdad wrote: > On Friday, 11 May 2012 at 18:21:24 UTC, H. S. Teoh wrote: >> Templates are stencils for generating code. There's nothing confusing about >> that. > > > "Stencils for generating code"? _This_??! :O > > template hasMember(T, string name) > { enum hasMember = __traits(hasMember, T, name); } > > > Imagine a new user's confusion when seeing something like this. > (Not sure I got it exactly right, but my point is there.)
Yeah, the eponymous template syntax is confusing. Something like template enum hasMember(T, string name) = __traits(hasMember, T, name); would be more intuitive, but i'm not sure yet if it would also work for more complex cases. Together with a new alias syntax it could make template alias ID(A...) = A; etc possible. artur