On 26 November 2012 18:44, Adam D. Ruppe <destructionator@gmail.com> wrote:
On Monday, 26 November 2012 at 16:32:17 UTC, Manu wrote:
Blargh.. they do that purposefully to, there's a check if(isCallable!T) on the thingy.And fail! functionAttributes breaks when I pass basically anything that's not a function >_<
You could use that same check though: if !isCallable!T, it cannot be a property right now, so no need to do the other check.
template isProperty(T) if(isCallable!T) {
enum bool isProperty = (functionAttributes!T & FuncAttribute.property) ? true : false;
}
template isProperty(T) if(!isCallable!T) {
enum bool isProperty = false; // it isn't callable, so can't be a property
}