Header `execution` and `std::reduce` not found
c++, c++17, header
Solution
`std::reduce` and `std::execution::par` are available since C++17.
For most of the compilers C++17 isn't fully implemented yet. You can try using clang with flag `-std=c++1z`.
Problem
I am trying to get this snippet to compile ``` #include <vector> #include <numeric> #include <execution> double result = std::reduce(std::execution::par, v.begin(), v.end()); ``` I tried these compilers: ``` Apple LLVM version 8.1.0 (clang-802.0.42) clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final) g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609 ``` All three give me `'execution' file not found` respectively `error: no member named 'reduce' in namespace 'std' auto result = std::reduce(v.begin(), v.end());` for this snippet ``` #include<numeric> #include<vector> int main(int argc, char *argv[]) { std::vector<double> v(10, 1); auto result = std::reduce(v.begin(), v.end()); return 0; } ``` I guess my compilers are too old? But on cppreference it does not say which compiler version is requiered minimum and also I do not see any newer versions for clang or gcc in the repo.