Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#Actualwintertime

Posted 27 January 2013 - 11:05 AM

1. That has nothing to do with virtual inheritance. Its to leave the possibility open that programmers make a class hierarchy with more than 2 steps where they continuously add common functionality first and later more specialized. If you try to make a BorderedWindow or WindowWithMenu you will see the compiler guards against this because its an abstract class like Window.
2. Should be the same if it both compiles.

Btw., you should always add a virtual destructor to any baseclass with a virtual method to prevent errors when you only have a pointer or reference to a baseclass which you initialized with an object of the derived class.

#1wintertime

Posted 27 January 2013 - 11:03 AM

1. That has nothing to do with virtual inheritance. Its to leave to possibility that programmers make a class hierarchy with more than 2 steps where they continuously add common functionality first and later more specialized. If you try to make a BorderedWindow or WindowWithMenu you will see the compiler guards against this because its an abstract class like Window.

2. Should be the same if it both compiles.

 

Btw., you should always add a virtual constructor to any baseclass with a virtual method to prevent errors when you only have a pointer or reference to a baseclass which you initialized with an object of the derived class.


PARTNERS