C++11 in XCode 4.5

March 26, 2013

I was messing around with XCode today, and found out clang++ that’s available with XCode 4.5.2, already has the C++11 standard available even though g++ still doesn’t.

jupiter:tmp jonathan$ clang++ --version
Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin12.3.0
Thread model: posix


You can compile with it using clang++ --std=c++11 -stdlib=libc++ foo.cxx.

That said, it’s probably best to get the latest version of XCode.