#pragma once #include #include "concepts.h" namespace concepts { template concept Operator = Arithmetic && requires(F op, T* f_curr, T* f_next, ARGS... args) { F::apply(f_curr, f_next, args...); }; template concept Functor = Arithmetic && requires(F f, T* f_curr, T output[F::size]) { F::observe(f_curr, output); }; } template struct Operator { M& mask; std::tuple args; Operator(F, M& m, ARGS&&... args): mask(m), args(std::forward(args)...) { } template requires concepts::Operator void operator()(U f_curr[], U f_next[]) { std::apply([](auto... args) { F::apply(args...); }, std::tuple_cat(std::make_tuple(f_curr, f_next), args)); } }; template Operator(F, M&, ARGS&&... args) -> Operator;