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

book: avoid "let the compiler deduce the list by itself" #277

Merged
merged 1 commit into from May 20, 2024

Conversation

frederick-vs-ja
Copy link
Contributor

resolve #276

Description

The standard fully specifies which entites are implicitly captured. So it could be misleading if we say "let the compiler deduce the list", which possibly implies that compilers has additional freedom.

Change List

  • Resolve error content of description of the implicit capture of lambdas.

Reference

C++ standard working draft, [expr.prim.lambda.capture]


说明

标准完全指定哪些实体需要被捕获。从而如果我们说“让编译器自行推导列表”可能造成误导,因为这可能暗示编译器有额外的自由。

变化箱单

  • 解决了关于 lambda 隐式捕获的描述性错误

参考文献

C++ 标准工作草案, [expr.prim.lambda.capture]

@Mq-b
Copy link
Contributor

Mq-b commented May 11, 2024

在当前语境,此说法与用词足够简单,且也与我认为应该修改为的:

编译器会捕获 lambda 表达式中使用到的外围对象

意思相同。“使用”这个词语很重要,是必须的,而非所谓的毫无价值且充满歧义以及理解难度的“编译器自行推导”。

@changkun changkun merged commit 54e99e1 into changkun:master May 20, 2024
@frederick-vs-ja frederick-vs-ja deleted the no-deduction-by-itself branch May 21, 2024 01:35
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

Successfully merging this pull request may close these issues.

lambda 表达式隐式捕获用“编译器自行推导”这种措辞极度不合适
3 participants