isDisposable

Tests if something is a Disposable.

template isDisposable (
T
) {
enum bool isDisposable;
}

Examples

1 struct A
2 {
3     void dispose()
4     {
5     }
6 }
7 
8 class B
9 {
10     void dispose()
11     {
12     }
13 }
14 
15 interface C
16 {
17     void dispose();
18 }
19 
20 static assert(isDisposable!A);
21 static assert(isDisposable!B);
22 static assert(isDisposable!C);