Lecture 5
LECTURE 5:
Templates and The Standard Library
Kurt Nørmark
Department of Computer Science, Aalborg University
Title page
Abstract
References from this lecture
Exercises in this lecture
Source programs in this lecture
Page 1
Templates
Page 21
Insert iterators
Page 2
Templates
Page 22
Standard Containers
Page 3
Templates versus generics in Java, C# and C++
Page 23
Documentation of the container library
Page 4
Example - Point<C>
Page 24
Overview of containers
Page 5
Class templates in C++
Page 25
A priority queue example
Page 6
Example - Point<C,dim,default_value>
Page 26
A map example
Page 7
Function templates
Page 27
Common properties of containers
Page 8
Policies with Templates
Page 28
Container member types
Page 9
Example of Policies with Templates
Page 29
A vector specialization: vector<bool>
Page 10
Template Specialization
Page 30
Algorithms
Page 11
Example - Specialization of Point<C> to Point<char>
Page 31
Documentation of the algorithms library
Page 12
Specialization of class templates - complete and partial
Page 32
Overview of Algorithms
Page 13
Compile time computations with template specialization
Page 33
Principles used for algorithms
Page 14
Vector Basics
Page 34
The for-each algorithm
Page 15
Vectors - basic use
Page 35
Function objects
Page 16
Iterators
Page 36
Using the sort algorithm
Page 17
Iterators seen as generalized pointers
Page 37
An example of for-each and function objects
Page 18
Example uses of iterators - basis stuff
Page 38
Use of function objects in STL
Page 19
Different classifications of iterators
Page 39
Adapter examples
Page 20
Categories of iterators
Generated: Tuesday March 26, 2013, 13:03:51