Lecture overview -- Keyboard shortcut: 'u'  Previous page: Example - Point<C,dim,default_value> -- Keyboard shortcut: 'p'  Next page: Policies with Templates -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Help page about these notes  Alphabetic index  Course home  Lecture 5 - Page 7 : 39
Notes about C++
Templates and The Standard Library
Function templates

Functions outside classes can also be defined as templates

y:/Kurt/Files/Advanced-programming-cpp/cpp/kn/templates/functions/vers1/cmp.ccThe template function compare, and various uses of it.


We make a version of class Point with an overloaded < operator

y:/Kurt/Files/Advanced-programming-cpp/cpp/kn/templates/functions/vers2/point.hClass Point with comparison operator friends.


y:/Kurt/Files/Advanced-programming-cpp/cpp/kn/templates/functions/vers2/point.ccThe implementation of class Point.


y:/Kurt/Files/Advanced-programming-cpp/cpp/kn/templates/functions/vers2/cmp.ccThe template function compare used for Point comparison.


Inappropriate actual type parameters are simply discovered by the compiler

Appropriateness is not expressed by inheritance relationships

Type parameter may be deduced automatically in function templates