Visual Studio 2010 中的右值引用
Visual Studio 2010 中实现的右值引用与 C++11 中指定的右值引用之间有什么区别?在 Visual Studio 2010 中使用重值引用时是否有任何需要注意的特定陷阱,如果由符合 C++11 的编译器编译,这些陷阱可能会导致源无效或工作方式不同?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据 这个表,VS2010支持右值引用2.0版本(当前版本是2.1 IIRC)。
2.0 和 2.1 之间的重要区别在于后者允许隐式转换:
另请注意,VS2010 尚不支持
*this
右值的重载。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:
Also note that VS2010 does not yet support overloading on the rvalueness of
*this
.查看 Stephan T. Lavavej 视频讲座的第 9 期,网址为 频道 9 从42:30 分钟开始。他解释了 Visual Studio 中右值引用和移动语义的时间线和演变。
这是:C9 讲座:Stephan T. Lavavej - 标准模板库 (STL),9 of n
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