D dropped in favour of C# for PSP emulator

Walter Bright newshound2 at digitalmars.com
Fri May 11 16:46:48 PDT 2012


On 5/11/2012 12:02 PM, Mehrdad wrote:
> On Friday, 11 May 2012 at 18:53:57 UTC, H. S. Teoh wrote:
>> On Fri, May 11, 2012 at 08:38:41PM +0200, Mehrdad wrote:
>>> template hasMember(T, string name)
>>> { enum hasMember = __traits(hasMember, T, name); }
> [...]
> It's more like, I can imagine someone asking these:
>
> 1. Why the heck do I see "hasMember" twice?
> 2. What does this have to do with enums?
> 3. Where is anything getting "returned"???
> 4. So you mean templates are THINGS?? I thought you needed a template SOMETHING,
> like a template struct, template function, etc...

I tend to agree. I think this is better (I've never gotten around to 
implementing it):

   enum hasMember(T, string name) = __traits(hasMember, T, name);

I.e. analogously to struct templates.


More information about the Digitalmars-d mailing list