Listing 5: Smart function pointer dereferencing and calling

class function_ptr
{
public:
    ...
    void operator()() const
    {
        if(body)
            body->call();
    }
    function_ptr &operator*()
    {
        return *this;
    }
    const function_ptr &operator*() const
    {
        return *this;
    }
    ...
};