What are the differences between rvalue references as implemented in Visual Studio 2010 and as specified in the C++11? Are there any particular pitfalls to watch out for when using revalue references in Visual Studio 2010 that could make source invalid or working differently if compiled by C++11 conforming compiler?
Asked
Active
Viewed 945 times
2 Answers
5
According to this table, VS2010 supports rvalue references version 2.0 (the current version is 2.1 IIRC).
The important difference between 2.0 and 2.1 is that the latter allows implicit conversions:
std::string&& x = "hello"; // legal in 2.1, illegal in 2.0
Also note that VS2010 does not yet support overloading on the rvalueness of *this
.
void Foo::foo() && { ... } // not yet supported in VS2010

fredoverflow
- 256,549
- 94
- 388
- 662
1
Check the instalment number 9 of Stephan T. Lavavej's video lectures at Channel 9 from 42:30 min onwards. He explains timeline and evolution of the rvalue references and move semantic in Visual Studio.
Here it is: C9 Lectures: Stephan T. Lavavej - Standard Template Library (STL), 9 of n

mloskot
- 37,086
- 11
- 109
- 136