On May 5, 3:03=A0pm, ".rhavin grobert" <cl...@[EMAIL PROTECTED]
> wrote:
> [insert ya favorite greetin' here;-)]
Hi
> when some does a...
>
> A.GetB()->AMethodOfB();
>
> ... and you want some code be executed before B::AMethodOfB() is
> called, you simply pack it into A::GetB()'s body before the return.
> But what do yuo do, if you want to execute some code _after_ B's
> method is executed, e.g. when the callstack - after completing the
> call into B - returns back into A::GetB()?
It is not called from GetB, therefore does not
returns there.
Instead of returning B* directly, return
object by value that returns B* from overrided operator -> ,
and place your entry code in constructor, exit code
in destructor of that object.
Hope this helps.
Greetings, Branimir.


|