* single virtual inheritance
@ 2008-07-13 1:04 - -
2008-07-13 6:57 ` Martin Krischik
0 siblings, 1 reply; 2+ messages in thread
From: - - @ 2008-07-13 1:04 UTC (permalink / raw)
To: gcc-help
What is the cost, if any, of inheriting a virtual base class only once
(not using multiple inheritance) vs. non-virtual single inheritance?
Thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: single virtual inheritance
2008-07-13 1:04 single virtual inheritance - -
@ 2008-07-13 6:57 ` Martin Krischik
0 siblings, 0 replies; 2+ messages in thread
From: Martin Krischik @ 2008-07-13 6:57 UTC (permalink / raw)
To: gcc-help
[-- Attachment #1: Type: text/plain, Size: 724 bytes --]
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
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 186 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-07-13 6:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-13 1:04 single virtual inheritance - -
2008-07-13 6:57 ` Martin Krischik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).