Skip to content

Commit 4be259f

Browse files
committed
docs: note the MSVC version floor for import std in C++20 mode
1 parent af88aba commit 4be259f

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

docs/05-mcpp-toml.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ repo = "https://github.com/user/myapp" # Repository URL (optional)
5151
`standard` is the first-class setting for the C++ language standard. Recommended values:
5252

5353
- `c++23`: the default, suited to the current module-based default templates.
54-
- `c++20`: the lowest level mcpp accepts — named modules are a C++20 feature, so nothing below it exists for this build model. Use it when an external constraint (an older in-house rule, a third-party API that stops at C++20) forces the level down. `import std;` still works there: it is a C++23 *library* feature, but GCC (≥ 15), Clang + libc++ (≥ 17) and the MSVC STL all provide the `std` module in C++20 mode as well. Note that C++23 library facilities (`std::print`, `std::expected`, …) are not available, including in the code generated by `mcpp new`.
54+
- `c++20`: the lowest level mcpp accepts — named modules are a C++20 feature, so nothing below it exists for this build model. Use it when an external constraint (an older in-house rule, a third-party API that stops at C++20) forces the level down. `import std;` still works there: it is a C++23 *library* feature, but GCC (≥ 15), Clang + libc++ (≥ 17) and the MSVC STL (from VS 2022 17.8) all provide the `std` module in C++20 mode as well. Note that C++23 library facilities (`std::print`, `std::expected`, …) are not available, including in the code generated by `mcpp new`.
5555
- `c++26`: use when you need C++26 language features.
5656
- `c++2a` / `c++2c`: compatibility aliases, normalized to `c++20` / `c++26` after parsing.
5757
- `gnu++20` / `gnu++23` / `gnu++26`: use when you need a GNU dialect; this enters the fingerprint and the std BMI cache key.

docs/zh/05-mcpp-toml.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ repo = "https://github.com/user/myapp" # 仓库地址(可选)
5151
`standard` 是 C++ 语言标准的一等配置。推荐值:
5252

5353
- `c++23`:默认值,适合当前模块化默认模板。
54-
- `c++20`:mcpp 接受的最低档位——命名模块本身是 C++20 特性,再往下这套构建模型就不存在了。当外部约束(公司内规、只到 C++20 的第三方 API)必须压低档位时使用。**`import std;` 在这一档依然可用**:它虽然是 C++23 的**特性,但 GCC(≥ 15)、Clang + libc++(≥ 17)与 MSVC STL 都在 C++20 模式下提供 `std` 模块。代价是 C++23 库设施(`std::print``std::expected` 等)不可用——包括 `mcpp new` 生成的模板代码。
54+
- `c++20`:mcpp 接受的最低档位——命名模块本身是 C++20 特性,再往下这套构建模型就不存在了。当外部约束(公司内规、只到 C++20 的第三方 API)必须压低档位时使用。**`import std;` 在这一档依然可用**:它虽然是 C++23 的**特性,但 GCC(≥ 15)、Clang + libc++(≥ 17)与 MSVC STL(VS 2022 17.8 起)都在 C++20 模式下提供 `std` 模块。代价是 C++23 库设施(`std::print``std::expected` 等)不可用——包括 `mcpp new` 生成的模板代码。
5555
- `c++26`:需要 C++26 语言特性时使用。
5656
- `c++2a` / `c++2c`:兼容别名,解析后分别归一为 `c++20` / `c++26`
5757
- `gnu++20` / `gnu++23` / `gnu++26`:需要 GNU dialect 时使用,会进入 fingerprint 和 std BMI cache key。

0 commit comments

Comments
 (0)