RcPtr.opEquals

Operator == and != . Compare pointers.

  1. bool opEquals(typeof(null) nil)
  2. bool opEquals(Rhs rhs)
  3. bool opEquals(Elm elm)
    struct RcPtr
    const @safe scope pure nothrow @nogc
    bool
    opEquals
    (
    Elm
    )
    (
    scope const Elm elm
    )

Examples

{
    RcPtr!long x = RcPtr!long.make(0);
    assert(x != null);
    x = null;
    assert(x == null);
}

{
    RcPtr!long x = RcPtr!long.make(123);
    RcPtr!long y = RcPtr!long.make(123);
    assert(x == x);
    assert(y == y);
    assert(x != y);
}

{
    RcPtr!long x;
    RcPtr!(const long) y;
    assert(x == x);
    assert(y == y);
    assert(x == y);
}

{
    RcPtr!long x = RcPtr!long.make(123);
    RcPtr!long y = RcPtr!long.make(123);
    assert(x == x.element);
    assert(y.element == y);
    assert(x != y.element);
}

Meta