The key different between a non-static and a static member function is that the latter doesn't have any object. It still has the same access privileges like all other members, however.
When you want to call a non-static member function from a static member, you still need to come up with an object, however. Often, the static member function would get passed in some context to get to an object. From the sounds of your question it seems that the static and the non-static functions are meant to do similar things which don't require and object. In this case it is probably best to factor the common part, not depending on any object, into another function which is then called from both call()
and Check()
:
void Test::call() {
common();
// ... other code
}
void Test::Check() {
common();
// ... other code, possibly depending on "this"
}
void Test::common() {
// logic shared by both call() and Check() but not depending on "this"
}
If the common code needs an object, there is no other way than coming up with an object in your static member function.