There are cases when you may want to return some special
value instead of an empty set. This is possible to do
with the coalescing operator - ??
. This operator
returns the first operand if it's not empty and the
second operand otherwise:
Similarly there are versions of the comparison operators
?=
and ?!=
that allow comparing to an empty set.
These operators always return a boolean value with the
rule that an empty set is equal to another empty set and
nothing else (other values work the same as for =
and
!=
). Try it out and compare to plain =
and !=
: