I was wondering if I can somehow make a call to the pre / post function in C ++. I have a wrapper class with many functions, and after each call to the wrapper function, I must always call the other one the same function.
Therefore, I do not want this call to postFunction () to call each of the following functions:
class Foo {
f1();
f2();
f3();
.
.
.
fn();
}
void Foo::f1() {
::f1();
postFunction();
}
void Foo::f2() {
::f2();
postFunction();
}
etc.
Instead, I want the postFunction call to be executed automatically when I call some member function Foo. Is it possible? This will help maintenance.
source
share