hasPropertyFunction

Is true iff T has a property member non-function named name.

template hasPropertyFunction (
T
string name
) {
enum hasPropertyFunction;
enum hasPropertyFunction;
}

Examples

1 struct S
2 {
3     int m;
4     static int sm;
5 
6     void f() {}
7     static void sf() {}
8 
9     @property int rp() { return m; }
10     @property void wp(int) {}
11 }
12 
13 static assert(hasPropertyFunction!(S, "rp"));
14 static assert(hasPropertyFunction!(S, "wp"));
15 
16 static assert(!hasPropertyFunction!(S, "na"));
17 static assert(!hasPropertyFunction!(S, "m"));
18 static assert(!hasPropertyFunction!(S, "sm"));
19 static assert(!hasPropertyFunction!(S, "f"));
20 static assert(!hasPropertyFunction!(S, "sf"));

Meta