The program below does not compile. Which statement correctly describes the problem?
#include <algorithm>
#include <iostream>
#include <vector>
int main() {
std::vector<int> v{3, 8, 12, 5};
int limit = 6;
auto n = std::count_if(v.begin(), v.end(), [](int x) { return x > limit; });
std::cout << n << '\n';
return 0;
}
Only globals and statics can be used without capturing.