[libcxx] `error: no member named 'par_unseq' in namespace 'std::execution'`
I stumbled upon something strange. If I compile the program
$ cat src/foreach_minimal.cpp
#include <algorithm>
#include <vector>
#include <execution>
void initzero(int& n){n=0;}
int main()
{
std::vector<int> v(100);
std::for_each(std::execution::par_unseq,v.begin(), v.end(),initzero);
return 0;
}
with
$ clang++ -O1 -Wall -std=c++2a -L/dev/shm/rydahl1/LLVM/install/lib/x86_64-unknown-linux-gnu/ -ltbb src/foreach_minimal.cpp -o bin/foreach_minimal
the system version of libc++ on my machine allows me to compile the naive program. If I instead add -stdlib=libc++, I get
error: no member named 'par_unseq' in namespace 'std::execution'
10 | std::for_each(std::execution::par_unseq,v.begin(), v.end(),initzero);
I used the commit eb5fe55b810cc186d2ff31b64294b0d666d623da for the installation.
We haven't implemented the PSRL fully yet, so you have to add -fexperimental-library to your command line.
Thank you, @philnik777! It works with -fexperimental-library -Wl,-rpath,install/lib/x86_64-unknown-linux-gnu/. Should I maybe update the libcxx documentation to mention that?
There is https://libcxx.llvm.org/UsingLibcxx.html#enabling-experimental-c-library-features. I guess we could list what is currently experimental.
There is https://libcxx.llvm.org/UsingLibcxx.html#enabling-experimental-c-library-features. I guess we could list what is currently experimental.
Not Found
The requested URL /UsingLibcxx.html was not found on this server.
Apache/2.4.7 (Ubuntu) Server at libcxx.llvm.org Port 443