2 problems I can't get my head around

Adam D. Ruppe destructionator at gmail.com
Mon Nov 26 07:44:53 PST 2012


On Monday, 26 November 2012 at 15:39:35 UTC, Manu wrote:
> Properties look like variables. How do I distinguish properties 
> from proper variables?

I think this will do it:

import std.traits;
bool isProperty = (functionAttributes!(S.P) & 
FunctionAttributes.property) ? true : false



The way that works in the implementation is checking the mangled 
name of the function. I wouldn't try anything else because any 
other difference between a property and a variable is arguably a 
bug since they are supposed to be mostly interchangable!


More information about the Digitalmars-d mailing list