IsMultipleOf Filter

template<typename T, size_t Multiple>
struct IsMultipleOf

Filter that only accepts values that are multiples of a specified number.

This filter propagates changes only when the new value is evenly divisible by the specified multiple, useful for quantization or alignment checks.

Since

v0.1.0

// Example: Only propagate multiples of 10
Signal<int, 10, IsMultipleOf<int, 10>> aligned(0);

Warning

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

  • Multiple cannot be zero.

Template Parameters:
typename T

Integral type.

size_t Multiple

The divisor to check against.

Public Functions

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

See Also