AnyMatch Filter

template<typename T, auto Predicate>
struct AnyMatch

Filter that accepts if any element matches a predicate.

This filter applies a compile-time predicate to elements in the collection and propagates when at least one element satisfies the predicate.

Since

v0.1.0

// Example: Accept vectors with at least one negative element
auto is_negative = [](int x) { return x < 0; };
Signal<std::vector<int>, 10, AnyMatch<std::vector<int>, is_negative>>
data({});

Warning

  • Only supports std::array or std::vector types.

  • Predicate must be callable with element type and return bool.

Template Parameters:
typename T

Collection type (std::array or std::vector).

auto Predicate

Compile-time predicate function for elements.

Public Functions

inline bool operator()(const T &old_value, const T &new_value) const
template<typename U>
struct is_std_array : public std::false_type
template<typename U>
struct is_std_vector : public std::false_type

See Also