Quote:Original post by nerijus ramanauskas
Only if there is a polymorphism, compiler is unable to do this, because it simply cannot know where is your memory.
It will PROBABLY be unable to do this, but that isn't a certainty.
The reason being, most compilers (that i know of anyways!) implement the vtable by having a hidden pointer at the beginning of your objects memory which points to the classes vtable.
However, the implemenation of how that works isn't specified in the standards so each compiler can implement it differently if they wish to.
So, one compiler might implement it in a way where in the example case, using polymorphism will work just fine :P
Minor trivia but knowledge is good so figured id clear that up (even though others have hinted at it)