C++20 in Xcode 11.4.1?

Does anyone know how to enable the current Clang C++20 feature support in Xcode 11.4.1?


Neither C++2a, nor C++20 appear to be an option in the project's Apple Clang - Language - C++ settings for C++ Language Dialect.

Replies

I use a config file (.xcconfig), and set the build setting CLANG_CXX_LANGUAGE_STANDARD = c++2a. Look at the config file support in the Xcode help to figure out how to use a config file.

FYI, just discovered that you can go into the C++ Language Dialect setting under Build Settings, select Other.. then type c++2a and press Enter.


Tested with new string functions starts_with/ends_with from C++20 and the program compiled/ran.

Post not yet marked as solved Up vote reply of pjd Down vote reply of pjd
  • I tried c++2a in Language Dialect setting to enable span feature. It still gives error

  • It worked when I included -std=c++2a -stdlib=libc++ as Other C++ Flags in Settings

Add a Comment