isAmong

  1. bool isAmong(Value needle, Values haystack)
    bool
    isAmong
    (
    alias pred =
    (
    a
    ,
    b
    )
    => a == b
    Value
    Values...
    )
    (
    Value needle
    ,
    Values haystack
    )
    if (
    Values.length != 0
    )
  2. template isAmong(values...)

Return Value

Type: bool

true iff needle is equal to any of haystack, false otherwise.

Examples

assert(`b`.isAmong(`a`, `b`));
assert(!`c`.isAmong(`a`, `b`));

Meta