当前位置:网站首页>How to read "STL source code analysis"?
How to read "STL source code analysis"?
2022-07-24 17:49:00 【User 6557940】
As C++ developer , I think this book is a must read ( The premise is that you must know STL Container usage and commonly used algorithms ). In addition to reading aloud with emotion , We should mainly understand the following knowledge points :
- traits
- allocator principle : such as 16 What's the matter with a free linked list , How to apply for memory from the memory pool , How to expand the capacity when the capacity is insufficient ?
- The bottom principle of each container , That's the point ! Also know , In specific scenarios , How to choose which containers , In a variety of optional containers , How about the performance of each container ? image map and set The principle of the red black tree at the bottom , The principle of hash table ,deque And so on
- functor : This part is very small , It looks relatively easy
- iterator : To combine with the container , Understand the underlying principles of various iterators
- Algorithm : You need to know the commonly used algorithms , You still need to understand Lambda expression , Because algorithms often combine Lambda Use it together
If you read as soon as you come up , Maybe it's hard , One side , As mentioned in this book , need C++ Basics . On the other hand ,stl Involving templates 、 Extraction, etc C++ Of " Strange sexual skills ", It also involves the implementation of the algorithm , More complicated . So I strongly recommend combining master Hou Jie's video :STL And generic programming (B There is no station ...), Master Houjie combines the source code , Explain thoroughly , Impressive . Learn from Masters , Thinking will raise a level !
Finally, applications , I recommend two : One is to try to code and implement some simple containers , such as array,list,allocator. I have tried these myself , It seems simple , When it comes to implementation, I find that there are many simple container doorways . But overall, the process is interesting . It is said that every C++ Programmers will implement one by themselves stl,github There are many personal versions on stl, It seems that I am not , Ha ha ha
Two is leetcode Brush problem , Containers are used in many topics , Apart from the most commonly used vector, Targeted training, such as hash table 、map The title of the label , Will deepen right stl Container understanding . Some topics even examine the performance of various containers , For example, high-frequency examination questions LRU The implementation of the .
Combined with my recent work , Apart from vector, To find efficiency unordered_set and unordered_map I will give priority to . Code often refers to STL、lambda、 Algorithm and C++11/14 Features are combined .
Sometimes I often feel that my skill is not enough , You have to study and practice all the time !
边栏推荐
- 仅需一个依赖给Swagger换上新皮肤,既简单又炫酷!
- 20 -- validate palindrome string
- Colleges and universities have introduced 23 Philippine doctors with heavy funds, and the relevant departments have launched an investigation!
- Getaverse, a distant bridge to Web3
- ShardingSphere数据库读写分离
- [leetcode] 30. Concatenate substrings of all words
- C语言中的字符与字符串库函数的使用以及模拟实现
- Development Series III of GaN (lapgan, srgan)
- C language custom type explanation - structure
- int8 & int8,你栽过这样的跟头吗?
猜你喜欢

es(1)

ShardingSphere数据库读写分离

获取同程(艺龙)酒店数据

Common questions of testers during interview

Can Lu Zhengyao hide from the live broadcast room dominated by Luo min?

分家后印象笔记过日子依然不好过,骚操作却不少

Brats18 - Multimodal MR image brain tumor segmentation challenge continued

Array learning navigation

Dry goods | three sub domain name collection tools worth collecting

OpenCV 图片旋转
随机推荐
(mandatory) override equals must override hashcode (principle analysis)
ROC and AUC details of the recommended system
wallys/IPQ8074A 4x4 2.4G 8x8 5G 802.11ax
Getaverse, a distant bridge to Web3
How to remove the top picture of the bubble skin article details of solo blog
0621~ES&Lucene
Image information is displayed by browser: data:image/png; Base64, + image content
TCP protocol debugging tool tcpengine v1.3.0 tutorial
700. Search DFS method in binary search tree
Common questions of testers during interview
The ability to detect movement in vivo and build a safe and reliable payment level "face brushing" experience
Shardingsphere database read / write separation
T245982 「KDOI-01」醉花阴
0614~ holiday self study
0623~放假自习
20 -- validate palindrome string
Dry goods | three sub domain name collection tools worth collecting
0614~放假自习
The solution of single chip microcomputer not supporting printf floating point type
Awk from entry to earth (17) awk multiline writing