Lecture overview -- Keyboard shortcut: 'u'  Previous page: What about prevention of derivation in C++ -- Keyboard shortcut: 'p'  Next page: Multiple inheritance - issues and C++ solutions -- Keyboard shortcut: 'n'  Lecture notes - all slides together  Annotated slide -- Keyboard shortcut: 't'  Alphabetic index  Help page about these notes  Course home    Abstraction Mechanisms, Part 2 - slide 12 : 24

Pointer to members

A pointer to a member function corresponds to a function pointer

Useful for activation of an unknown/arbitray method among several possible of the same signature

The two special C++ operators   .*  and   ->*   bind a pointer to member to a specific object (accessed without or via a pointer respectively)

point.h
Class variant of class Point with several different move functions.
point.cc
Implementation of class Point and the tree move methods - not important for the example.
prog.cc
A program that illustrates pointer to Point member functions.

It is also possible to estabslish a pointer to a data member

The notation associated with pointers to members is a challenge, at least at first sight