olymp-cpp-lib
olymp-cpp-lib copied to clipboard
C++20 aggregator improve
to get rid of wrappers use c++20 constexpr lambdas to pass merge function as template parameter
aggregator<monoid> - old style must be supported (constructor is merge function)
aggregator<int, gcd<int,int>> - pass function
aggregator<int, bit_xor{}> - pass struct as invocable
aggregator<int, [](int a, int b) { return a; }> - pass lambda