Virtual Function and Vtable
-
Hello Friends, I have virtual function in my class and I don't want the vtable to be created. Can anybody help regarding this one. Is there any method for the above problem or any keyword, which helps the programmer to avoid creating vtable for the class. Thanks in advance, Neelesh K J Jain.
-
Hello Friends, I have virtual function in my class and I don't want the vtable to be created. Can anybody help regarding this one. Is there any method for the above problem or any keyword, which helps the programmer to avoid creating vtable for the class. Thanks in advance, Neelesh K J Jain.
Neelesh K J Jain wrote: Is there any method for the above problem or any keyword, which helps the programmer to avoid creating vtable for the class. No. If you have a virtual function, there must be a vtable.
Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
-
Hello Friends, I have virtual function in my class and I don't want the vtable to be created. Can anybody help regarding this one. Is there any method for the above problem or any keyword, which helps the programmer to avoid creating vtable for the class. Thanks in advance, Neelesh K J Jain.
I doubt you can do anything of that, but incase if you were able to then your function would lose its advantage of being virtual and be as good as any other functions of your class. If that's ok then why not to remove the virtual keyword of the function. "Reading made Don Quixote a gentleman. Believing what he read made him mad" - Nilesh
-
Hello Friends, I have virtual function in my class and I don't want the vtable to be created. Can anybody help regarding this one. Is there any method for the above problem or any keyword, which helps the programmer to avoid creating vtable for the class. Thanks in advance, Neelesh K J Jain.
Neelesh K J Jain wrote: I don't want the vtable to be created :confused: Why you don't want to create VTABLE?, Any specfic reason!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta
-
Neelesh K J Jain wrote: I don't want the vtable to be created :confused: Why you don't want to create VTABLE?, Any specfic reason!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta
Actually I had been asked this question in one of my interview recently. My feeling is that if we could be able to avoid creating of Vtable, then I agree with the reply of Nilesh. No use of having virtual functions itself. So, I just wanted to know whether we can avoid creation of vtable, then how? Neelesh K J Jain.
-
Actually I had been asked this question in one of my interview recently. My feeling is that if we could be able to avoid creating of Vtable, then I agree with the reply of Nilesh. No use of having virtual functions itself. So, I just wanted to know whether we can avoid creation of vtable, then how? Neelesh K J Jain.
Neelesh K J Jain wrote: I had been asked this question in one of my interview recently Hain, What's the result, Are you selected or Not!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta
-
Neelesh K J Jain wrote: I had been asked this question in one of my interview recently Hain, What's the result, Are you selected or Not!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta
The interviewer probably wanted you to talk about the
novtable
attribute. This attribute is microsoft specific and is declared in front of the class name as__declspec(novtable)
. Giving this will not put the code in the constructor of the class to initialize the virtual table pointer of the class. But the virtual table will still be created. « Superman » -
Hello Friends, I have virtual function in my class and I don't want the vtable to be created. Can anybody help regarding this one. Is there any method for the above problem or any keyword, which helps the programmer to avoid creating vtable for the class. Thanks in advance, Neelesh K J Jain.