IsPositive Filter

template<typename T>
struct IsPositive

Filter that only accepts positive values (> 0).

This filter propagates changes only when the new value is strictly greater than zero, useful for filtering out negative or zero values.

Since

v0.1.0

// Example: Only propagate positive measurements
Signal<float, 10, IsPositive<float>> distance(0.0);

Warning

Only accepts arithmetic types (integral and floating-point).

Template Parameters:
typename T

Arithmetic type.

Public Functions

inline bool operator()(const T &old_value, const T &new_value) const

See Also