Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ Leda > vi rutal helly
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 183 of 212
Post > Topic >>

vi rutal helly

by "puzzlecracker" <ironsel2000@[EMAIL PROTECTED] > Jan 14, 2005 at 12:09 PM

I am sure people are familiar with dirty diamond problem solved by
virtual inheritance.   look at the code below and tell me how many
instances of the base class (in this case A) does class D receive?


class A
{
:
:



};


class B: virtual public A {

:
:



};


class C: virtual public A {

:
:



};


class D: public B, public C, virtual public A {

:
:



};


====

A small follow up: is inheritance by default public, protected or
private such class A: B{};?


what is the difference between
class A
{
:
:



};


class B: virtual public A {

:
:



};


class D:public B {

:
:



};


OR

class D: virtual public B {


:
:



};


============
Next: can you inline the virtual functions? is the behavior undefined,
nonstandard, etc?




 1 Posts in Topic:
vi rutal helly
"puzzlecracker"  2005-01-14 12:09:24 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed May 14 6:43:49 CDT 2008.