Consider this class: class Widget { public: virtual void mf1() = 0; virtual void mf2() const = 0; virtual int someVal() = 0; virtual ~Widget() {} };
The class is abstract and has no meaningful virtual function implementations. There is no reason for this class to have a vtbl nor for its (implicit) constructors or its destructor to adjust the vptr, because there is no way to use them that will not lead to undefined behavior. Some other compilers either omit the vtpr/vtbl code and data for such classes or offer programmers a way to suppress it (e.g., Microsoft's __declspec(novtable)). I can't find any information that suggests that gcc supports such an optimization, which is especially of interest in the embedded community. Does anybody know definitively whether gcc does or does not offer this optimization?
Thanks, Scott _______________________________________________ help-gplusplus mailing list help-gplusplus@gnu.org http://lists.gnu.org/mailman/listinfo/help-gplusplus