| 163 | |
| 164 | template <typename Bop, typename Proj> |
| 165 | auto check(Bop bop, Proj proj) { |
| 166 | return [bop, proj]<class T>(std::vector<T> const &in) { |
| 167 | // |
| 168 | |
| 169 | std::vector<T> tmp; |
| 170 | |
| 171 | for (auto &&elem : in) { |
| 172 | tmp.push_back(proj(elem)); |
| 173 | } |
| 174 | |
| 175 | std::vector<T> out(in.size()); |
| 176 | |
| 177 | std::inclusive_scan(tmp.begin(), tmp.end(), out.begin(), bop); |
| 178 | |
| 179 | return out; |
| 180 | }; |
| 181 | } |
| 182 | |
| 183 | auto doubler = [](auto const &X) -> decltype(2 * X) { |
| 184 | return 2 * X; |