Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does OS X 10.7 libc++ support c++14?

I'm updating a project to use the latest Qt and taking the opportunity to switch to libc++ and C++11 at the same time. My understanding is that OS X 10.7 and above support this without me needing to ship my own build of the standard library. I'm happy to no longer support OS X versions <10.7.

C++11 support is great, but I'd really like to use C++14.

Does the libc++ installed for end-users with OS X >10.7 also support C++14 standard library features?

My guess is 'Yes' and that it's kept up to date by OS updates in >10.7 - but I've been unable to find a definitive source stating this to be the case.

like image 948
Dan Groom Avatar asked Oct 19 '22 11:10

Dan Groom


1 Answers

Probably not. Apple shipped the last update for Mac OS X 10.7 (10.7.5) in October 2012; it's unlikely that the libc++.dylib has been updated since then (the only exception that I could think of is for security issues)

Xcode ships with a set of headers that change with what SDK you target; if you target a particular system (say 10.7), you get those headers.

Compare the contents of /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/ and /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/ too see what I mean.

For template-only features, you could use your own set of headers from a later LLVM release - but then you would be taking the burden of ensuring compatibility upon yourself.

like image 197
Marshall Clow Avatar answered Oct 22 '22 01:10

Marshall Clow