is there any way to disable compiler optimisation for a specific line of code?(有什么方法可以禁用特定代码行的编译器优化?)
问题描述
有什么方法可以禁用 Visual Studio 中特定代码行的编译器优化?
没有.
仅在逐个函数的基础上使用 优化编译指示:
#pragma optimize("[优化列表]", {on | off} )
<块引用>
optimize pragma 必须出现在函数之外并在之后定义的第一个函数看到 pragma.开和关arguments 中指定的选项打开或关闭优化列表.
用法:
#pragma optimize("", off)...#pragma 优化(",开)
is there any way to disable compiler optimisation for a specific line of code in Visual studio?
No.
Only on a function-by-function basis using the optimize pragma:
#pragma optimize( "[optimization-list]", {on | off} )
The optimize pragma must appear outside a function and takes effect at the first function defined after the pragma is seen. The on and off arguments turn options specified in the optimization-list on or off.
usage:
#pragma optimize( "", off )
.
.
.
#pragma optimize( "", on )
这篇关于有什么方法可以禁用特定代码行的编译器优化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:有什么方法可以禁用特定代码行的编译器优化?


- 与 int by int 相比,为什么执行 float by float 矩阵乘法更快? 2021-01-01
- 使用/clr 时出现 LNK2022 错误 2022-01-01
- 近似搜索的工作原理 2021-01-01
- 从python回调到c++的选项 2022-11-16
- STL 中有 dereference_iterator 吗? 2022-01-01
- 静态初始化顺序失败 2022-01-01
- Stroustrup 的 Simple_window.h 2022-01-01
- 如何对自定义类的向量使用std::find()? 2022-11-07
- C++ 协变模板 2021-01-01
- 一起使用 MPI 和 OpenCV 时出现分段错误 2022-01-01