I am trying to apply a lambda to the elements of an std::array.
std::array<int, 4> fixIndices = {1, 60, 127, 187};
std::apply(
[](int id) {
std::cout << id;
},
fixIndices);
However, this simple code doesn't compile
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/include/c++/tuple:1727:27: error: no matching function for call to ‘__invoke(****)::<lambda(int)>, int&, int&, int&, int&)’
1727 | return std::__invoke(std::forward<_Fn>(__f),
| ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
1728 | std::get<_Idx>(std::forward<_Tuple>(__t))...);
What am I missing?