Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 C++ Builder XE6,并且正在尝试使用移动构造函数进行一些测试,以将结果与复制构造函数进行比较。无论如何,即使在编译器设置中选中“禁用所有优化”,我的编译器也会强制执行 RVO 优化。是否有一些额外的参数需要发送到编译器?
你正在寻找-fno-elide-constructors.
-fno-elide-constructors
我在 Embarcadero 的文档中没有看到任何记录;然而,这是 clang 使用的标志,当我使用 bcc64 6.70 尝试它时,它确实具有预期的效果。