Posts

Showing posts with the label stateful

Using stateful functors

For another example posts on functors (function objects) see here . A functor is an instance of a C++ class that has the operator() defined. One big advantage of functors is that when you define the operator() in C++ classes you not only get objects that can act like functions, but can also store state as well.