I was wondering if I could do pre/post function call in C++ somehow. I have a wrapper class with lots of functions, and after every wrapper function call I should call another always the same function.
So I do not want to put that postFunction() call to every single one of the functions like this:
class Foo {
f1();
f2();
f3();
.
.
.
fn();
}
void Foo::f1() {
::f1();
postFunction();
}
void Foo::f2() {
::f2();
postFunction();
}
etc.
Instead I want that postFunction call to come automatically when I call some Foo's member function. Is it possible? It would help maintenance..