Visibility.opCmp

Checks if this is less or more visible than other

struct Visibility
extern (D) const pure nothrow @nogc @safe
int
opCmp

Parameters

other Visibility

Visibility to compare this to.

Return Value

Type: int

A value < 0 if this is less visible than other, a value > 0 if this is more visible than other, and 0 if they are at the same level. Note that package visibility with different packages will also return 0.

Examples

assert(Visibility(Visibility.Kind.public_) > Visibility(Visibility.Kind.private_));
assert(Visibility(Visibility.Kind.private_) < Visibility(Visibility.Kind.protected_));
assert(Visibility(Visibility.Kind.package_) >= Visibility(Visibility.Kind.package_));

Meta