Skip to Content
C++程序设计语言(第4部分:标准库)(原书第4版)
book

C++程序设计语言(第4部分:标准库)(原书第4版)

by 本贾尼 斯特劳斯特鲁普
August 2021
Intermediate to advanced
450 pages
6h 57m
Chinese
Pearson
Content preview from C++程序设计语言(第4部分:标准库)(原书第4版)

32.8 建议

[1]STL算法操作一个或多个序列;32.2节。

[2]一个输入序列是一个半开区间,由一对迭代器定义;32.2节。

[3]进行搜索时,算法通常返回输入序列的末尾位置表示“未找到”;32.2节。

[4]优选精心说明的算法而非“随意代码”;32.2节。

[5]当你要编写一个循环时,思考它是否可以表达为一个通用算法;32.2节。

[6]确保一对迭代器实参确实指定了一个序列;32.2节。

[7]当迭代器对风格显得冗长时,引入容器/范围版本的算法;32.2节。

[8]用谓词和其他函数对象赋予标准算法更宽泛的含义;32.3节。

[9]谓词不能修改其实参;32.3节。

[10]指针上默认的==和<极少能满足标准算法的需求;32.3节。

[11]了解你使用的算法的时间复杂性,但要记住复杂性评价只是对性能的粗略导引;32.3.1节。

[12]只在对一个任务没有更专用的算法时使用for_each()和transform();32.4.1节。

[13]算法并不直接向其实参序列添加元素或从其中删除元素;32.5.2节、32.5.3节。

[14]如果不得不处理未初始化的对象,考虑uninitialized_*系列算法;32.5.6节。

[15]STL算法基于其排序比较操作实现相等性比较,而不是使用==;32.6节。

[16]注意,排序和搜索C风格的字符串要求用户提供一个字符串比较操作;32.6节。

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

算法精讲视频课程:24篇系列讲座

算法精讲视频课程:24篇系列讲座

罗伯特·塞奇威克, 凯文·韦恩(Kevin Wayne)
可编程网络自动化

可编程网络自动化

Jason Edelman, Scott S. Lowe, Matt Oswalt
C语言核心技术(原书第2版)

C语言核心技术(原书第2版)

Peter Prinz, Tony Crawford
Go程序设计语言

Go程序设计语言

艾伦A. A.多诺万, 布莱恩W. 柯尼汉

Publisher Resources

ISBN: 9787111544395