Lecture overview -- Keyboard shortcut: 'u'  Previous page: Use of function objects in STL -- Keyboard shortcut: 'p'    Lecture notes - all slides together  Annotated slide -- Keyboard shortcut: 't'  Alphabetic index  Help page about these notes  Course home    Templates and The Standard Library - slide 39 : 39

Adapter examples

We show a couple of example of Adapters

Adaption of an operator (+) and adaptation of a member function (print in Point)

plus-1.cpp
An illustration of plus<double>.
plus-3.cpp
A possible definition of plus.
plus-4.cpp
Another definition of plus - as a function template.
memb-adapt-1.cpp
Use of member function adaption, with mem_fun_ref.
point.h
The definition of Point - point.h.