isObservable

Tests if something is a Observable.

  1. template isObservable(T, E)
    template isObservable (
    T
    E
    ) {}
  2. template isObservable(TObservable)

Members

Variables

isObservable
enum bool isObservable;
Undocumented in source.

Examples

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));

Meta