ErrorCode.opEquals

Equality with another error code or error code number.

  1. bool opEquals(ErrorNo that)
  2. bool opEquals(ErrorCode that)
    struct ErrorCode
    const @nogc nothrow pure @safe
    bool
    opEquals
    ()

Parameters

that ErrorCode

Numeric error code.

Return Value

Type: bool

Whether $(D_KEYWORD this) and that are equal.

Examples

ErrorCode ec1 = ErrorCode.fault;
ErrorCode ec2 = ErrorCode.accessDenied;

assert(ec1 != ec2);
assert(ec1 != ErrorCode.accessDenied);
assert(ErrorCode.fault != ec2);
ErrorCode ec1 = ErrorCode.fault;
ErrorCode ec2 = ErrorCode.fault;

assert(ec1 == ec2);
assert(ec1 == ErrorCode.fault);
assert(ErrorCode.fault == ec2);

Meta