IsNegative Filter

template<typename T>
struct IsNegative

Filter that only accepts negative values (< 0).

This filter propagates changes only when the new value is strictly less than zero, useful for detecting errors or abnormal conditions.

Since

v0.1.0

// Example: Only propagate negative temperatures
Signal<float, 10, IsNegative<float>> temp(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