diff --git a/ClockReceiver/Dispatcher.hpp b/ClockReceiver/Dispatcher.hpp index e7046bce2..460f2aa8a 100644 --- a/ClockReceiver/Dispatcher.hpp +++ b/ClockReceiver/Dispatcher.hpp @@ -11,18 +11,10 @@ namespace Dispatcher { -/// The unity function; converts n directly to n. -struct UnitConverter { - constexpr int operator ()(int n) { - return n; - } -}; - -template +template struct Dispatcher { - /// Perform @c target.perform() for the input range `start <= n < end`; - /// @c ConverterT()(n) will be applied to each individual step before it becomes the relevant template argument. + /// Perform @c target.perform() for the input range `start <= n < end`. template void dispatch(SequencerT &target, int start, int end, Args&&... args) { @@ -46,15 +38,15 @@ private: // // Sensible choices by the optimiser are assumed. -#define index(n) \ - case n: \ - if constexpr (n <= max) { \ - if constexpr (n == max) return; \ - if constexpr (n < max) { \ - if(use_end && end == n) return; \ - } \ - target.template perform(args...); \ - } \ +#define index(n) \ + case n: \ + if constexpr (n <= max) { \ + if constexpr (n == max) return; \ + if constexpr (n < max) { \ + if(use_end && end == n) return; \ + } \ + target.template perform(args...); \ + } \ [[fallthrough]]; #define index2(n) index(n); index(n+1);