libstdc++-v3/testsuite/26_numerics/reduce/95833.cc
raw| 1 | // { dg-do compile { target c++17 } } |
| 2 | // PR libstdc++/95833 - Incorrect static_assert in std::reduce overload |
| 3 | |
| 4 | #include <numeric> |
| 5 | |
| 6 | struct A { }; |
| 7 | struct B { }; |
| 8 | |
| 9 | struct binop |
| 10 | { |
| 11 | template<typename T, typename U> |
| 12 | A operator()(T&&, U&&) const { return A{}; } |
| 13 | }; |
| 14 | |
| 15 | B b; |
| 16 | A a = std::reduce(&b, &b + 1, A{}, binop{}); |