My application has me calling a bunch of callbacks that need to know their last state, or the state of the last invocation. A simple instance is the time difference between two successive invocations.
I know that function objects in c++ are a generic way to do that. But I am a nOOb and not sure how to set this schema up. Any help or specific simple code examples will be much appreciated.
Just make a class that implements operator(). For instance,
You can then create and instance which will be callable and retain state.