Xor Filter

template<typename Filter1, typename Filter2>
struct Xor

Logical XOR - exactly one filter must accept.

This filter combinator propagates only when EXACTLY ONE of the two filters accepts, implementing exclusive OR logic for conditional filtering.

Since

v0.1.0

// Example: Accept even OR negative, but not both
Signal<int, 10, Xor<IsEven<int>, IsNegative<int>>> value(0);

Note

Preserves both filter states.

Warning

  • Both filters must have valid operator() for comparison.

Template Parameters:
typename Filter1

First filter type.

typename Filter2

Second filter type.

Public Functions

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

Public Members

mutable Filter1 filter1
mutable Filter2 filter2

See Also