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!