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.
相关问题
- Sorting 3 numbers without branching [closed]
- How to compile C++ code in GDB?
- Why does const allow implicit conversion of refere
- How to know full paths to DLL's from .csproj f
- Importing NuGet references through a local project
相关文章
- How to show location of errors, references to memb
- Class layout in C++: Why are members sometimes ord
- Log4Net Multiple Projects
- How to mock methods return object with deleted cop
- Which is the best way to multiply a large and spar
- How to track MongoDB requests from a console appli
- C++ default constructor does not initialize pointe
- Selecting only the first few characters in a strin
There is never any reason to disable this optimisation! What are you trying to achieve? It helps debug builds run faster without any bad side-effects at all. It also ensures code dependent on RVO or NRVO works identically in debug and release.
You cannot. It is just that simple. RVO/NRVO is Standard, and your code should not depend on it not being present.
Try to define your variable as
volatile
, maybe solves your problem. If it does not, you should send come code...