I know you said to excuse the syntax, but there is a glaring error in the fact that you use the this pointer in your static member function. I'm sure you know that static functions execute outside the context of the object, so this is not available.
As for your question, it depends on the function. When an object is destroyed, the member data is destroyed -- not the code. To understand this, you have to know how classes actually work.
Generally, a class like this:
Code:
class MyClass
{
public:
void add(int i) { num += i; }
private:
int num;
};
Will compile down to something equivalent to this:
Code:
struct MyClass
{
int num;
}
void add(MyClass* this, int i)
{
this->num += i;
}
So the functions are still around even when the class itself is gone.
To break it down to the simplest answer: if your member function does not access member data or call other member functions, it will probably continue to run without any problems.
However, I'm fairly sure this type of behavior is undefined and should be avoided in all situations.
Hope that helped.
-tf