In general, I would think that it would be better to just test that the expression you want to use compiles (e.g. is(typeof(var.prop))
), but if for some reason you really need to know that a function is marked with @property
, then you can use std.traits.functionAttributes to get that information. Something like
enum isProperty = (functionAttributes!(MyType.prop) & FunctionAttribute.property) != 0;
should work.