Rooot.net

  • Increase font size
  • Default font size
  • Decrease font size
Those who desire to give up freedom in order to gain security will not have, nor do they deserve, either one - Benjamin Franklin
Home


C++ member function pointers and delegates

Delegates is a concept widely used in design patterns like Observer or Strategy.

Standard C++ doesn't provide delegates, but this can be implemented using member function pointers. The problem is that C++'s object-oriented function pointers have a complicated syntax and have wierd behavior when dealing with inherited classes.

There has been a lot of discussion on this topic and many implementations exists.

Read more...