In Lippman's
Inside the C++ Object Model mentioned about the pure virtual function in base class's vtable also possesses a slot(index) , while calling it through indirect call will cuz the program to abort.(A prevention of calling). Although the pure virtual function still can be called through statically calling method, and also could have implementation(for virtual destructor).
With the basic understanding of vptr, vtable, here are some article talking about ATL_NO_VTABLE, which expands to __declspec(novtable) in ATL.
Paul DiLascia :
Explain about the detail of __declspec(novtable)
MSDN :
novtable
Blogger's explanation :
vtable and __declspec(novtable) (aka ATL_NO_VTABLE)
Stackoverflow :
Is there a g++ equivalent to Visual Studio's __declspec(novtable)?
We know that typeinfo were embedded inside the vtable,
so here's the question with nice answer:
Does using __declspec(novtable) on abstract base
classes affect RTTI in any way?
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.