cpp-2013 #9 stl algorithms part 1

15
STL algorithms Part 1

Upload: eleks-developers-courses-if

Post on 24-Jan-2015

665 views

Category:

Documents


3 download

DESCRIPTION

 

TRANSCRIPT

Page 1: cpp-2013 #9 STL Algorithms Part 1

STL algorithmsPart 1

Page 2: cpp-2013 #9 STL Algorithms Part 1

Iterators

Page 3: cpp-2013 #9 STL Algorithms Part 1

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

Functors

Page 5: cpp-2013 #9 STL Algorithms Part 1

Functor• What is functor?

Functor

Function Function objects

LambdasHandwritten

Page 6: cpp-2013 #9 STL Algorithms Part 1

Functor• operator()• unary_function, binary_function

Page 7: cpp-2013 #9 STL Algorithms Part 1

Algorithms

Page 8: cpp-2013 #9 STL Algorithms Part 1

Algorithms• Why it’s better to use STL algorithms• Global STL algorithms overview

Page 9: cpp-2013 #9 STL Algorithms Part 1

Non-modifyingalgorithms

Page 10: cpp-2013 #9 STL Algorithms Part 1

for_each

• Overview• Examples

Page 11: cpp-2013 #9 STL Algorithms Part 1

count, count_if

• Overview• Examples

Page 12: cpp-2013 #9 STL Algorithms Part 1

find, find_if

• Overview• Examples

Page 13: cpp-2013 #9 STL Algorithms Part 1

equal

• Overview• Examples

Page 14: cpp-2013 #9 STL Algorithms Part 1

all_of, any_of, none_of

• Overview• Examples

Page 15: cpp-2013 #9 STL Algorithms Part 1

Questions?