IsOdd Filter

template<typename T>
struct IsOdd

Filter that only accepts odd integer values.

This filter propagates changes only when the new value is an odd number, determined by checking if the value modulo 2 is non-zero.

Since

v0.1.0

// Example: Only propagate odd counts
Signal<int, 10, IsOdd<int>> oddCounter(1);

Warning

Only accepts integral types (int, long, etc.).

Template Parameters:
typename T

Integral type.

Public Functions

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

See Also