Skip to content

Conversation

@Mq-b
Copy link
Contributor

@Mq-b Mq-b commented Oct 9, 2024

修改 auto 的错误措辞,格式化格式

```

> {{ icon.fun }} C++11:auto 只能用于定义变量;C++14:函数返回类型可以是 auto;C++17:模板参数也可以 auto;C++20:函数参数也可以是 auto 了;(狂想)C++47:auto 现在是 C++47 的唯一关键字,用户只需不断输入 auto-auto-auto,编译器内建人工智能自动识别你的意图生成机器码。
> {{ icon.fun }} C++11:auto 只能用于定义变量以及作为函数返回类型的占位符(无法自行推导);C++14:函数返回类型可以是 auto 并自动推导;C++17:模板非类型参数也可以 auto;C++20:函数参数也可以是 auto 了;(狂想)C++47:auto 现在是 C++47 的唯一关键字,用户只需不断输入 auto-auto-auto,编译器内建人工智能自动识别你的意图生成机器码。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C++14 就能有 auto 函数参数,虽然只能用在 lambda 里。 可以将 C++20 的相关改动视为解决了 C++14/17 中存在两套互斥的函数模板语法这一奇怪现象。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

泛型lambda

Copy link
Contributor

@archibate archibate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

伟人

@archibate archibate merged commit 4c4ad97 into parallel101:main Nov 9, 2024
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.

3 participants