Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.3 中的 typeof 不是 C++ 中的标准特性 #286

Open
frederick-vs-ja opened this issue May 20, 2024 · 1 comment
Open

2.3 中的 typeof 不是 C++ 中的标准特性 #286

frederick-vs-ja opened this issue May 20, 2024 · 1 comment

Comments

@frederick-vs-ja
Copy link
Contributor

Actual Description

  • File Path: book/en-us/02-usability.md
  • Original paragraph: 2.3
The `decltype` keyword is used to solve the defect that the auto keyword can only type the variable. Its usage is very similar to `typeof`:

typeof is a common extension provided by many compilers, but is no yet standardized in C++. It is recently standardized in C (see WG14 N2927).

We should consider how to mention typeof.

Expected Description


实际描述

  • 文件路径:book/en-us/02-usability.md
  • 原文段落:2.3
`decltype` 关键字是为了解决 `auto` 关键字只能对变量进行类型推导的缺陷而出现的。它的用法和 `typeof` 很相似:

typeof 是许多编译器提供的常见扩展,但未在 C++ 标准化。它最近在 C 中被标准化(见 WG14 N2927)。

我们应考虑如何提及 typeof

预期描述

@Mq-b
Copy link
Contributor

Mq-b commented May 21, 2024

在这个语境中提起,显然是默认 typeof 相比于 decltype 是更加常见的,那必然不是指代 C23 标准化的 typeof ,也只不过是在说编译器扩展,不考虑别的直接在这里强调 GCC 编译器扩展即可。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants