如何禁用在Visual Studio 2010中的返回值优化? [英] How to disable return value optimization in Visual Studio 2010?
本文介绍了如何禁用在Visual Studio 2010中的返回值优化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以在Visual Studio 2010中禁用RVO(返回值优化)?将优化标志设置为 / Od
(关闭所有优化)不起作用。在g ++中存在禁用RVO的标志 -fno-elide-constructors
。
Is it possible to disable RVO (return value optimization) in Visual Studio 2010? Setting optimization flag to /Od
(turns off all optimizations) doesn't help. In g++ there exists flag -fno-elide-constructors
which disables RVO.
推荐答案
你不能。这只是这么简单。 RVO / NRVO是标准的,你的代码不应该依赖它不存在。
You cannot. It is just that simple. RVO/NRVO is Standard, and your code should not depend on it not being present.
这篇关于如何禁用在Visual Studio 2010中的返回值优化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文