VS2010 is supposedly coming out tomorrow– I’ve been using the release candidate for the last few months and have found it to be a great improvement over VS2008.
VS2010 supports 6 new language level features from C++0x, which is not alot, but they did add some of the important ones at least.
New Language Features:
Lambda’s: Instead of writing incredibly verbose functors/function objects(and often enough not in the location where they are actually used)– you can now use the very succinct lambda syntax to declare an anonymous function that behaviors like a functor. While this doesn’t allow you do anything you couldn’t already do in C++, the resulting code is much shorter and you no longer have to write tedious functor constructors to accept external state. I’ve found lambda support in C++ to be quite awesome.
R-Value references: A new reference type which will bind to temporary’s, this allowed for the introduction of move constructors and move assignment operators– which steal their resources from R-value references. This features allows for faster performing code by the removal of needless copying.
One of the remaining issues with C++ STL is that it often results in a good amount of data copying going on– the addition of R-Value references allows for any STL implementation that takes advantage of them to reduce the amount of copying that occurs(which the VS2010 Dinkumware STL does).
decltype: can deduce the type of an expression– for example this can be used to get the return type of a function. Another useful tool for generic programming.
static_assert: compile time asserts that will print whatever message you specified, this is nice because you can add a useful description of the problem, better then using C++ hackery to get a description with lots of underscores.
nullptr: so you can say float* ptr = nullptr instead of 0. One problem with this is that it uses the same keyword as the C++/cli version, but has a different meaning, so MS has added a non-standard __nullptr which will always act as the native nullptr, even in C++/cli. I like this addition, but the conflict with C++/cli is annoying.
auto: you can now declare an objects type to be auto and the compiler will attempt to deduce which type it is, this allows for more concise code(especially when it comes to iterators) and is useful for generic programming. Nice feature.
C++0x features that didn’t make it include variadic templates, strongly typed enums(so tired of wrapping enums in classes/namespaces), initializer lists, template typedefs, and foreach.
New stuff in the standard library
forward_list – singly-linked list– cool, but I rarely use list so I doubt I’ll use this much either
unique_ptr – now this is I find very very useful, it takes advantage of R-Value references to allow it to be stored in STL containers(unlike auto_ptr), and includes support for a custom deleter similar to shared_ptr
The IDE
The new UI allows you to break off parts of the UI and then drag them outside of the primary window, I’m using a multi-monitor setup at home, so I can drag my output window & search window to the 2nd monitor. Very nice..
Intellisense: from the brief period I attempted to use VS2010 without Visual Assist it did appear to be improved
Concurrency Runtime: Microsoft has been busy working on two C++ systems for handling concurrency– the Asynchronous Agents Library and the Parallel Patterns Library, so far I’ve only dabbled around with the PPL, but I do like what I’ve seen. It does pretty much stick you with windows though, so perhaps forking over $300 for intel’s TBB might be a better route.
F#: I don’t know this language yet, but it was added as a first class language with full intellisense support etc. I’m gonna spend some time learning the language as I’d like to know a functional language.
And boo to Perforce, I’d have expected perforce would have a working plugin for VS2010 by now, but alas they have nothing.
Tags: C++, Visual Studio