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

[代码错误] 6.3 迭代器 代码清单6-80 #320

Open
bytemain opened this issue Feb 1, 2021 · 0 comments
Open

[代码错误] 6.3 迭代器 代码清单6-80 #320

bytemain opened this issue Feb 1, 2021 · 0 comments
Labels
第六章 第六章

Comments

@bytemain
Copy link

bytemain commented Feb 1, 2021

页码与行数

第一版 第七次印刷

  • 第207页
  • 倒数第二段,倒数第5行

代码错误

代码清单6-80,第4行

- fold(0, |acc, x| acc+x)
+ fold(0, |acc, &x| acc+x)

此处使不使用引用都可以。

但是因为下一页的第一段说:代码 6-80 中 fold 传入的是一个引用,并且后面都是介绍为什么是一个引用的参数。
所以这里的代码应该就是 &x

@ZhangHanDong ZhangHanDong added the 第六章 第六章 label Feb 1, 2021
@ZhangHanDong ZhangHanDong added this to the 第八次印刷 milestone Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
第六章 第六章
Projects
None yet
Development

No branches or pull requests

2 participants