5 ms·
The Biggest Changes in C++11 (and Why You Should Care)
- nicholassmith 14y agoI'm really looking forward to when the standard is implemented across most compilers. There's some great new features that I hope goes some way to addressing some of the complaints levied at C++ (there's still plenty left to go).
- stephen_g 14y agoThe support is actually pretty good - since the standard went through such a long process, most compilers had support for at least some of the features as long as a couple of years ago (back around the TR1 draft). I already use it for some little new projects. I'm sure a lot of legacy stuff won't be able to move on to the new standard for a while because they need backwards compatibility with old compilers though.
- nicholassmith 14y agoNo doubt it's getting there, but with a couple of the big ones (MSVC especially) missing chunks it's hard to shift over completely. I've used it a few times with GCC and I've been pretty much happy with all the new features, looking forward to using it a bit more often.
- whazzmaster 14y agoVS2010 implemented much of the C++11 feature set, and VS2012 implements almost all of it. See http://msdn.microsoft.com/en-us/library/vstudio/hh567368.aspx http://msdn.microsoft.com/en-us/library/vstudio/hh567368.asp... for a table comparison of C++11 support. I'm itching to start using this stuff in QuickBooks; I love smart pointers but hate auto_ptr and being able to safely use STL containers with smart pointers opens a new world of entity processing.
- nicholassmith 14y agoAh awesome, last time I looked there was a few things missing that looked a bit of an oversight. I was trying to remember when exactly but it must have been a while ago.
- snogglethorpe 14y agoUnfortunately there's still lots of stuff missing, e.g. delegated constructors and, probably most significantly, constexpr. The apache table[+] has been updated as of this month, and MSVC (with a version given as "11.0 nov'12") now is looking rather better, but is still missing constexpr... :( Still, it appears that there should be fairly good support in all major compilers within the next few years, at least if you can depend on your devs using relatively up-to-date compiler releases (not at all a given where I work!)... :] [+] http://wiki.apache.org/stdcxx/C%2B%2B0xCompilerSupport http://wiki.apache.org/stdcxx/C%2B%2B0xCompilerSupport
- fafner 14y agohttps://wiki.apache.org/stdcxx/C%2B%2B0xCompilerSupport https://wiki.apache.org/stdcxx/C%2B%2B0xCompilerSupport
- stinos 14y ago"C++11 still lacks a few useful libraries such as an XML API, sockets, GUI, reflection" that's a bit of a strange statement, no? Since when is a GUI or even an XML API part of the core language features? And adding reflection would, erm, kinda mean that every compiler has to be rewritten almost from scratch.
- stingraycharles 14y agoThere's rumour about C++14/C++17 supporting reflection: http://root.cern.ch/drupal/content/c14 http://root.cern.ch/drupal/content/c14
- vilya 14y agoThe c++ standard library is pretty sparse if you compare it to python's or java's, say. Good point about reflection; personally I don't miss it though. Where I would have used it in java, for example, I often find I can get a better result using templates - it just takes a bit more thought.
- qznc 14y agoC++ already needs runtime type information [0] for certain features (dynamic_cast, typeid). So the basic compiler infrastructure is already there. No need to "rewrite from scratch". Just add more information into the RTTI data structures and provide the mechanisms to inspect (optionally modify) classes. [0] http://en.wikipedia.org/wiki/Run-time_type_information http://en.wikipedia.org/wiki/Run-time_type_information
- stinos 14y agogood point actually, didn't think that through. Still full reflection like in C# for instance seems quite a long way from RTTI.
- nimrody 14y agoToo bad "Concepts" did not make it into the standard. Would help avoid the tons of unintelligible error messages one gets when using template functions incorrectly. Given that C++ libraries are getting so complex (now with move semantics!) there is no way a library user can understand why something does not work as expected. Especially when dealing with sophisticated libraries: Boost, Eigen, etc.
- stingraycharles 14y ago> Too bad "Concepts" did not make it into the standard. Would help avoid the tons of unintelligible error messages one gets when using template functions incorrectly. As far as I understood it, this was merely due to discussions what types of Concepts would be supported. There was one group of people that wanted very granular Concepts, and another group of people that wanted just very broadly defined Concepts. They never reached an agreement on this.
- Negitivefrags 14y agoWe didn't get concepts, but I think that in the long term it is a good thing. Instead of that we will probably get a more D like static if which basically does everything concepts did but it much easier to implement and understand.