Trigger event on return in C++
<p>I want to execute some function right before the return of another function. The issue is that there are multiple returns and I don't want to copy-paste my call before each of them. Is there a more elegant way of doing this? </p>

<pre><code>void f()
{
    //do something
    if ( blabla )
        return;
    //do something else
    return;
    //bla bla
}
</code></pre>

<p>I want to call g() before the function returns.</p>
