On 2/2/16 2:04 PM, NX wrote:
On Tuesday, 2 February 2016 at 03:36:25 UTC, Steven Schveighoffer wrote:
int y() { return 1;}
No need for meta-programming hackery, mark it as @property:
int y() @property { return 1;}
I don't have control over S. I am passed S and need to figure out that
it qualifies as a type I can use.
I also figured this out on my own, but for some reason my reply didn't
go through. This is what I came up with:
template propertyType(alias x)
{
static if(is(typeof(x) == function))
alias propertyType = typeof(x());
else
alias propertyType = typeof(x);
}
-Steve