NonZero Filter

template<typename T>
struct NonZero

Filter that only accepts non-zero values.

This filter propagates changes only when the new value is not zero, useful for filtering out default/null states.

Since

v0.1.0

// Example: Only propagate non-zero readings
Signal<int, 10, NonZero<int>> sensorValue(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