Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) Adapter

 

An adapter is a type of functor that allows a method or a pointer to a function to be used as an argument to algorithms [1].

 

Most adapters can be found in the header file functional.

 

There are four types of adapters [1]:

 

 

 

 

 

 

STL and Boost adapters

 

One can distinguish STL and Boost adapters by their namespace: All STL objects are in namespace std. All Boost objects are in namespace boost.

 

 

 

 

 

 

References

 

  1. Bjarne Stroustrup. The C++ Programming Language (3rd edition). 1997. ISBN: 0-201-88954-4. Chapter 18.4.4: 'A member function adapter allows a member function to be used as an argument to algorithms. A pointer to function adapter allows a pointer to a function to be used as an argument to algorithms.'

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict