|
|
|
|
|
by Figs
5424 days ago
|
|
The term "functor" is widely used -- including such places as SGI's STL documentation (http://www.sgi.com/tech/stl/functors.html) and numerous other reference sites. According to Bruce Eckel's Thinking in C++ Vol 2 (in the section describing the Command Pattern), the term dates to 1992: > In Advanced C++: Programming Styles And Idioms (Addison Wesley, 1992), Jim Coplien coins the term functor which is an object whose sole purpose is to encapsulate a function (since “functor” has a meaning in mathematics, we shall use the more explicit term function object). The point is to decouple the choice of function to be called from the site where that function is called. Unfortunately, I don't have a copy of Advanced C++: Programming Styles and Idioms, so I can't verify this myself. But, if it's accurate, that means the term predates the standard by at least six years since ISO/IEC 14882 was released in 1998... :) Personally, I do prefer "function object" though, since it seems like a clearer term. |
|