Set.opBinaryRight

$(D_KEYWORD in) operator.

struct Set(T, alias hasher = hash)
const
bool
opBinaryRight
(
string op : "in"
U
)
(
auto ref const U value
)
if (
ifTestable!(U, a => T.init == a)
)
if (
isHashFunction!(hasher, T)
)

Parameters

U

Type comparable with the element type, used for the lookup.

value U

Element to be searched for.

Return Value

Type: bool

$(D_KEYWORD true) if the given element exists in the container, $(D_KEYWORD false) otherwise.

Examples

Set!int set;

assert(5 !in set);
set.insert(5);
assert(5 in set);
assert(8 !in set);

Meta