I’m running macOS Monterey 12.6.1 on a Macbook Air and there are no further updates available. I checked my AppleClang version and it’s 14.0.0. If I compile a simple C++ code using e.g. std::boyer_moore_searcher
, the function is not found like pointed out in this post. Is there any reason why a C++17
feature is still not supported? Is there any way to get it working? I was unable to install the latest macOS Ventura since it’s not supported to install it even manually. Would the latest macOS solve the problem of seemingly outdated clang headers since I would then be able to further update other software?
Whether you're new to Xcode or an experienced developer, our archive has everything you need to know about this integrated development environment (IDE). From basic functionalities to advanced features, our archive covers a wide range of Xcode-related questions and answers. Browse our archive now and find solutions to your Xcode questions, and take your app development skills to the next level
2
Answers
https://en.cppreference.com/w/cpp/17
According to this chart, Apple Clang still has no support for the execution policies you want.
Since normal Clang does not support this either yet, you can try installing GCC and its standard library to use instead.
@DXPower
The table is actually not very clear, if you read the line "Parallel algorithms and execution policies" you will find the Intel Parallel STL table marked.
You can indeed use the parallel algorithms with clang, but you have to link against tbb and tbbmalloc (statically or dinamically), and download and install oneDPL from intel
Intel oneDPL
or install it with homebrew:
brew install onedpl
Once installed, you can access the algorithms from the folder
/opt/homebrew/include/oneapi (if installed with homebrew on Mac Os Ventura)
or in older OS under
/usr/local/include/oneapi
To avoid linking errors, it is better to include the headers in the following way (example)
and then you can call (example)
You can use the parallel stl in the same way in Android or iOS, see
Android ParallelSTL
I’ve been using the parallel stl this way since about 2020.
The procedure is the same whether you use Clang or Apple Clang.