How to use experimental parallel STL in C++1z?

Viewed 2489

I want to try parallel STL of C++17. However, I can't find experimental/execution_policy in libc++. How can I try this?

I'm trying http://en.cppreference.com/w/cpp/experimental/reduce, which says I should include these files, but I cannot find execution_policy.

#include <experimental/execution_policy>

After I install libc++ (I followed http://libcxx.llvm.org/docs/BuildingLibcxx.html), I tried the following commands, but in vain.

$ clang++-3.5 -std=c++1z test.cpp -lc++experimental
test.cpp:5:10: fatal error: 'experimental/execution_policy' file not found
#include <experimental/execution_policy>
         ^
1 error generated.

Is this not implemented yet?

3 Answers

Further to Jeff's answer ...

Both GCC and Clang now include the Intel PSTL implementation in order to provide the C++17 parallel algorithms in their C++ standard libraries.

At the time of writing, there is an additional dependency on the Intel TBB library, which the PSTL uses as its backend to provide parallelism.

Related