You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*我查了一下,函数参数用 auto 这个有点说法和历史的。C++11 不支持 auto。C++14/17 仅支持 lambda 表达式(也就是匿名函数)的 auto 参数,而到了 C++20 引入 **缩写函数模板** 语法糖后,才支持在非匿名函数中使用 auto 参数。C++20 里面在非匿名函数中使用 auto 会自动转换成模板函数。*
695
+
696
+
使用匿名函数,可以将任意语句变成表达式。
697
+
698
+
如果遇到了不含析构函数的对象(例如 C 代码),可以使用作用域终结函数(用匿名函数来实现的)来处理。
0 commit comments