Example 2: Class AutoTrace.

class AutoTrace
{
public:
   AutoTrace(const string & s) : m_line(s)
    {
        cout << endl << m_line << " - start";
    }

    ~AutoTrace()
    {
        cout << endl << m_line << " - finish";
    }
private:
    string m_line;  
};

void Foo(int x, int y)
{
    AutoTrace("Foo(int x, int y)");
    ...
}