How do I use <stop_token> in macOS?

Viewed 33

Consider the following MRE:

#include <stop_token>

int main() {
    std::stop_source ssource;
}

With the following C++ compiler build settings: enter image description here

this code emits the following error if I try to compile it with the latest "stable" Xcode in macOS (Version 14.0):

'stop_token' file not found

Which is weird because the same works flawlessly when checking in the compiler explorer.

I also tried to compile the file from command line but to no avail:

% clang++ -std=c++20 main.cpp
main.cpp:2:10: fatal error: 'stop_token' file not found
#include <stop_token>
         ^~~~~~~~~~~~
1 error generated.

The same is for -std=c++2b option.

Is this header located in some other (say, experimental) subdirectory in macOS?

0 Answers
Related