clang::mrdocs::contains_n_any

Determine if a range contains at least N instances of any of the specified elements.

Synopses

Declared in <mrdocs/Support/Algorithm.hpp>

Determine if a range contains at least N instances of any of the specified elements.

template<
    std::ranges::range Range,
    std::ranges::range Els>
requires std::equality_comparable_with<std::ranges::range_value_t<Els>, std::ranges::range_value_t<Range>>
bool
contains_n_any(
    Range const& range,
    Els const& els,
    std::size_t n);

Determine if a range contains at least N instances of any of the specified elements.

template<
    std::ranges::range Range,
    class El>
requires std::equality_comparable_with<El, std::ranges::range_value_t<Range>>
bool
contains_n_any(
    Range const& range,
    std::initializer_list<El> const& els,
    std::size_t n);

Return Value

True if the element is found, false otherwise.

Parameters

Name

Description

range

The range to search.

els

The elements to search for.

n

The number of instances to search for.

Created with MrDocs