OutsideRange Filter

template<typename T, T MinVal, T MaxVal>
struct OutsideRange

Filter that only accepts values outside a specified range.

This filter propagates changes only when the new value falls outside the specified inclusive range [MinVal, MaxVal], useful for detecting outliers.

Since

v0.1.0

// Example: Only propagate values outside normal range [20, 80]
Signal<int, 10, OutsideRange<int, 20, 80>> outlier(50);

Warning

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

  • MinVal must be less than or equal to MaxVal.

Template Parameters:
typename T

Arithmetic type.

T MinVal

Minimum value of exclusion range.

T MaxVal

Maximum value of exclusion range.

Public Functions

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

See Also