cmoon::meta::value_list<Values...>::any_of





template<class F>
[[nodiscard]] static constexpr bool any_of(F&& func) noexcept(/* see below */);


(1)

Checks every value against the given predicate.

Parameters

func - The predicate

Return value

true if std::invoke(func, Values) is true for any value in Values..., false otherwise.

Exceptions

1) noexcept specification:



noexcept(std::conjunction_v<std::is_nothrow_invocable<F, decltype(Values)>...>)


Example



import <concepts>;

import cmoon.meta;

struct 
{
    template<std::integral T>
    constexpr bool operator()(T t) const noexcept
    {
        return t % 2 == 0;
    }
} is_even {};

int main()
{
    using vl = cmoon::meta::value_list<2, 3, 3>;

    static_assert(vl::any_of(is_even));
}