3 ms·
Apple is not that great either. Newest xcode (last time I checked, few months ago) shipped with clang that didn't even understand lambdas. And even that partial
by UnFleshedOne 14y ago
Apple is not that great either. Newest xcode (last time I checked, few months ago) shipped with clang that didn't even understand lambdas. And even that partial C++11 support came a the cost of dropping support for OSX 10.6 (didn't have 10.6 SDK compiled with clang). So I had to undo basic C++11 stuff (some lambdas and autos mostly) I've done in VS2010...
- comex 14y ago$ cat test.cpp int main() { return ([]() { return 5; })(); } $ clang++ -std=c++11 -o test test.cpp $ Xcode 4.4.1.
- UnFleshedOne 14y agoLooks like lambdas are supported since 4.4, that's what I get on 4.3.2: main.cpp:7:30: current parser token ')' main.cpp:5:1: parsing function body 'main' main.cpp:5:1: in compound statement ('{}') clang: error: unable to execute command: Segmentation fault: 11 Too bad we are now locked for next year or so. (and of course 4.4 doesn't support OSX 10.6, so no C++11 for us anyway...)
- comex 14y agoEek. You can always install a newer compiler from MacPorts or whatever.
- X-Istence 14y agoI have been using auto and lambda's in my C++ code using clang since 10.6. Since 10.8 it has only improved. If you checked a few months ago you didn't check correctly.
- UnFleshedOne 14y agoWhat Xcode version/compiller settings/C++ lib settings and OSX SDK version did you use on 10.6? I found there is no good combination. Also lambdas are supported since xcode 4.4 which was released in july...