cpp-2013 #9 stl algorithms part 1
DESCRIPTION
TRANSCRIPT
![Page 1: cpp-2013 #9 STL Algorithms Part 1](https://reader036.vdocuments.us/reader036/viewer/2022082805/54c31cbd4a7959ff6b8b45c1/html5/thumbnails/1.jpg)
STL algorithmsPart 1
![Page 2: cpp-2013 #9 STL Algorithms Part 1](https://reader036.vdocuments.us/reader036/viewer/2022082805/54c31cbd4a7959ff6b8b45c1/html5/thumbnails/2.jpg)
Iterators
![Page 3: cpp-2013 #9 STL Algorithms Part 1](https://reader036.vdocuments.us/reader036/viewer/2022082805/54c31cbd4a7959ff6b8b45c1/html5/thumbnails/3.jpg)
Iterators• Why we need to have iterators• Features• iterator• reverse_iterator• const_iterator• What iterator type better to use• base() member
![Page 4: cpp-2013 #9 STL Algorithms Part 1](https://reader036.vdocuments.us/reader036/viewer/2022082805/54c31cbd4a7959ff6b8b45c1/html5/thumbnails/4.jpg)
Functors
![Page 5: cpp-2013 #9 STL Algorithms Part 1](https://reader036.vdocuments.us/reader036/viewer/2022082805/54c31cbd4a7959ff6b8b45c1/html5/thumbnails/5.jpg)
Functor• What is functor?
Functor
Function Function objects
LambdasHandwritten
![Page 6: cpp-2013 #9 STL Algorithms Part 1](https://reader036.vdocuments.us/reader036/viewer/2022082805/54c31cbd4a7959ff6b8b45c1/html5/thumbnails/6.jpg)
Functor• operator()• unary_function, binary_function
![Page 7: cpp-2013 #9 STL Algorithms Part 1](https://reader036.vdocuments.us/reader036/viewer/2022082805/54c31cbd4a7959ff6b8b45c1/html5/thumbnails/7.jpg)
Algorithms
![Page 8: cpp-2013 #9 STL Algorithms Part 1](https://reader036.vdocuments.us/reader036/viewer/2022082805/54c31cbd4a7959ff6b8b45c1/html5/thumbnails/8.jpg)
Algorithms• Why it’s better to use STL algorithms• Global STL algorithms overview
![Page 9: cpp-2013 #9 STL Algorithms Part 1](https://reader036.vdocuments.us/reader036/viewer/2022082805/54c31cbd4a7959ff6b8b45c1/html5/thumbnails/9.jpg)
Non-modifyingalgorithms
![Page 10: cpp-2013 #9 STL Algorithms Part 1](https://reader036.vdocuments.us/reader036/viewer/2022082805/54c31cbd4a7959ff6b8b45c1/html5/thumbnails/10.jpg)
for_each
• Overview• Examples
![Page 11: cpp-2013 #9 STL Algorithms Part 1](https://reader036.vdocuments.us/reader036/viewer/2022082805/54c31cbd4a7959ff6b8b45c1/html5/thumbnails/11.jpg)
count, count_if
• Overview• Examples
![Page 12: cpp-2013 #9 STL Algorithms Part 1](https://reader036.vdocuments.us/reader036/viewer/2022082805/54c31cbd4a7959ff6b8b45c1/html5/thumbnails/12.jpg)
find, find_if
• Overview• Examples
![Page 13: cpp-2013 #9 STL Algorithms Part 1](https://reader036.vdocuments.us/reader036/viewer/2022082805/54c31cbd4a7959ff6b8b45c1/html5/thumbnails/13.jpg)
equal
• Overview• Examples
![Page 14: cpp-2013 #9 STL Algorithms Part 1](https://reader036.vdocuments.us/reader036/viewer/2022082805/54c31cbd4a7959ff6b8b45c1/html5/thumbnails/14.jpg)
all_of, any_of, none_of
• Overview• Examples
![Page 15: cpp-2013 #9 STL Algorithms Part 1](https://reader036.vdocuments.us/reader036/viewer/2022082805/54c31cbd4a7959ff6b8b45c1/html5/thumbnails/15.jpg)
Questions?