Question

Can anyone suggest a way to determine the differences in c++11 support when using libc++ versus libstdc++ that ship with the Apple LLVM compiler?

In particular, I am currently using LLVM 4.1 that ships with Xcode 4.5.2.

Presumably, the answer depends in part on the level of c++11 support offered by clang for this version, and in part on the version of libc++ and libstdc++ were shipped with 4.1.

My general sense is that c++11 support is "nearly complete" these days when using libc++, but that you lose something when switching to libstdc++, but i can't figure out what -- a few simple c++11 features seem to work fine on both.

I get the sense that the c++11 support for the libstdc++ that ships with gcc 4.8 is pretty good, but I have no idea if the libstdc++ that ships with llvm 4.1 is old or not.

Also, I get the sense that there is no difference in the level of c++11 support (using llvm 4.1 with libc++) when compiling for osx or ios 6.01, but I'm not positive.

Any suggestions on how to figure all this out?

[Context: due to upstream dependencies,I might need to link to libstdc++ instead of libc++, so I want to figure out what I might be losing]

Was it helpful?

Solution

The libstdc++ that ships with LLVM 4.1 is gcc-4.2. That version has no C++11 support. It does have some tr1 support though.

Additionally, the best way to check for C++11 language features is to use clang's has_feature macro test.

For C++11 library features, you'll need to go with libc++.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top