MaxSize Filter

template<typename T, size_t MaxElements>
struct MaxSize

Filter that accepts collections with maximum size.

This filter validates collection size and propagates only when the collection does not exceed the specified maximum number of elements.

Since

v0.1.0

// Example: Accept vectors with at most 10 elements
Signal<std::vector<int>, 10, MaxSize<std::vector<int>, 10>> data({});

Warning

  • Only supports std::vector types.

  • MaxElements must be greater than 0.

Template Parameters:
typename T

Collection type (std::vector).

size_t MaxElements

Maximum number of elements allowed.

Public Functions

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

See Also