Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 5.1 enable C++14

Xcode 5.1 using Clang 3.4. And Clang 3.4 supports C++14.

However, I've been surfing though all of the Xcode options and don't see a way to enable C++14.

I'm trying to enable the relaxed constexpr feature of C++14

like image 618
Troy Harvey Avatar asked Apr 09 '14 03:04

Troy Harvey


1 Answers

To get this to work, you first set "C++ Language Dialect" to "compiler default". Then in "Other C++ flags" add "-std=c++1y".

This will allow Clang++ to compile with c++14 from within Xcode. I tested this with Xcode 5.1.1 using the new user defined literal for basic_string:

std::string word = "hello"s;

Update: As of Xcode 6, c++14 is available as a first-class language dialect.

like image 128
jbruni Avatar answered Sep 25 '22 08:09

jbruni