Hello,
First sorry for my poor English, I am French ;-)
I've got a comprehension problem of what happend in one of the project
i'm working on.
Basically I've got a class gs_object than has got a VIRTUAL function
createList(). This createList() function is overloaded in another class
named ct_server that inherits gs_object.
in my code, it looks something like that :
class gs_object {
...
virtual void createList();
...
};
class ct_server : public gs_object {
...
virtual void createList();
void initInstance();
...
};
Here is the problem :
in the function ct_server::init Instance, one boy of my team wanted to
call the gs_object::crea teList() base function, and not the overloaded
one (ct_server::cre ateList() ). But, according to me he made a mistake
as he wrote :
(static_cast<GS _object*>(this) )->createList() ;
instead of
gs_object::crea teList();
According to me, as createList() is virtual, this line of code should
call ct_server::crea teList and not gs_object::crea teList()
But it doesn't : when in run in debug mode, i can see it calls
gs_object::crea teList();
I can't understand why. Could you explain me ?
FYI, i'm using Visual C++ 7.1.3 ; Qt 3.3.4