hasFailure

Tests if something has failure method.

template hasFailure (
T
) {
enum bool hasFailure;
}

Examples

1 struct A
2 {
3     void failure(Exception e);
4 }
5 
6 struct B
7 {
8     void _failure(Exception e);
9 }
10 
11 struct C
12 {
13     void failure();
14 }
15 
16 static assert(hasFailure!A);
17 static assert(!hasFailure!B);
18 static assert(!hasFailure!C);