News for hackers. Stuff that matters.
Re:The Sorry State of C++ Portability by aidenn0 on Wednesday October 24, 2012 @02:35PM (#4694332)
TLDR: I'm pissed that a standard with significant new features that is less than a year old doesn't have enough mature implementations yet
Re:The Sorry State of C++ Portability by DannyBee on Wednesday October 24, 2012 @02:48PM (#4694407)
Well, not quite, because those features were "accepted" and public and well known and available in basically final form to implement for many years.

So it's not like the standard came out and everyone was like "whoa, new stuff we have to do". It came out piece by piece, and at some point was declared done. Like HTML5, only more organized and it got finished :)

This is why, for example, GCC and clang have had mature implementations in them for years.

In fact, GCC/Clang/et al having implementations was pretty much a pre-req to finishing the standard because they were used to discover bugs and issues in the proposed standard.

(edit: I'm simplifying a bit, since GCC, et al have had to make bug fixes for draft vs final incompatibilities and bugs that were discovered, but they are still relatively mature)

Re:The Sorry State of C++ Portability by coelhudo on Wednesday October 24, 2012 @03:27PM (#4694607)
Yeah, and a lot of features came from boost.
Re:The Sorry State of C++ Portability by comex on Wednesday October 24, 2012 @02:45PM (#4694394)
Another way of seeing it is that all the other major compilers (gcc, clang, icc) have good support but Microsoft's compiler, the one that best integrates with the Windows ecosystem, does not.
Re:The Sorry State of C++ Portability by UnFleshedOne on Wednesday October 24, 2012 @03:33PM (#4694632)
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...
Re:The Sorry State of C++ Portability by X-Istence on Wednesday October 24, 2012 @04:03PM (#4694786)
I 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.
Re:The Sorry State of C++ Portability by UnFleshedOne on Wednesday October 24, 2012 @04:34PM (#4694935)
What 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...
Re:The Sorry State of C++ Portability by comex on Wednesday October 24, 2012 @03:38PM (#4694652)

    $ cat test.cpp
    int main() {
        return ([]() { return 5; })();
    }
    $ clang++ -std=c++11 -o test test.cpp
    $ 
Xcode 4.4.1.
Re:The Sorry State of C++ Portability by UnFleshedOne on Wednesday October 24, 2012 @04:29PM (#4694905)
Looks 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...)

Re:The Sorry State of C++ Portability by comex on Wednesday October 24, 2012 @04:38PM (#4694955)
Eek. You can always install a newer compiler from MacPorts or whatever.