single virtual inheritance

Martin Krischik krischik@users.sourceforge.net
Sun Jul 13 06:57:00 GMT 2008


Am Sonntag 13 Juli 2008 schrieb - -:

> What is the cost, if any, of inheriting a virtual base class only once
> (not using multiple inheritance) vs. non-virtual single inheritance?

The cost is a single pointer redirection - the same as between 
using  "some_type some_var" and  "some_type& some_var".

But the gain is extensabitlity and maintainabiltiy. I have seen the neibouring 
team doing a one week 5 person refactoring run because they dicovered the 
value of  virtual inheritance to late.

Always remember: there is a cost of not using a feature as well - and it might 
be your weekend not beeing at home but doing refactoring.

Martin
-- 
Martin Krischik
mailto://krischik@users.sourceforge.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part.
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20080713/d63c393f/attachment-0001.sig>


More information about the Gcc-help mailing list