简体   繁体   English

我们可以将 c++ 标准编译与 MSVC 混合使用吗?

[英]Can we mix c++ standard compile with MSVC?

I think gcc is try to support this .我认为 gcc 试图支持这一点

But, I can't find any referrence for MSVC.但是,我找不到任何有关 MSVC 的参考资料。

My code base is currently build on c++17.我的代码库目前建立在 c++17 上。 I would like to use the new coroutine feature in c++20 but don't want to migrate all code rightnow.我想在 c++20 中使用新的协程功能,但现在不想迁移所有代码。 The goal is to build some components with coroutine support.目标是构建一些支持协程的组件。

The rules of MSVC binary compatibility apply. MSVC 二进制兼容性规则适用。 Objects are link-compatible (as long as you don't use link-time code generation or whole-program optimization) between versions.对象在版本之间是链接兼容的(只要您不使用链接时代码生成或整个程序优化)。 Since that page doesn't say that any other compiler switches beside /LTCG and /GL break this promise, /std: won't do that either.由于该页面没有说明/LTCG/GL旁边的任何其他编译器开关会破坏此 promise,因此/std:也不会这样做。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM