mrdocs::is_one_of

Determine if an element is equal to any of the elements in the specified range.

Synopses

Determine if an element is equal to any of the elements in the specified range.

template<
    class El,
    std::ranges::range Range>
requires std::equality_comparable_with<std::ranges::range_value_t<Range>, El>
bool
is_one_of(
    El const& el,
    Range const& range);

Determine if an element is equal to any of the elements in the specified range.

template<
    class U,
    class T>
requires std::equality_comparable_with<U, T>
bool
is_one_of(
    U const& el,
    std::initializer_list<T> const& range);

Return Value

True if the element is found, false otherwise.

Parameters

Name

Description

el

The element to search for.

range

The range to search.

Created with MrDocs