struct TestObservable { alias ElementType = int; Disposable subscribe(T)(T observer) { static assert(isObserver!(T, int)); return null; } } static assert(isObservable!(TestObservable)); static assert(isObservable!(TestObservable, int)); static assert(!isObservable!(TestObservable, Object));
static assert(isObservable!(Observable!int)); static assert(!isObservable!(Observer!int)); static assert(!isObservable!(string)); static assert(!isObservable!(Object));
Tests if something is a Observable.