generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Almost figured out virtual base classes

Previous Thread :: Next Thread 
Flurite is not online. Flurite
Joined: 03 Apr 2011
Total Posts: 5386
25 Jun 2012 07:06 PM
Okay, remember that one thread that went completely off topic? That's okay, because I found a quote that explains the construction of virtual base classes. I don't get it, but maybe you do.

In a non-delegating constructor, initialization proceeds in the following order:

First, and only for the constructor of the most derived class (1.8), virtual base classes are initialized in the order they appear on a depth-first left-to-right traversal of the directed acyclic graph of base classes, where “left-to-right” is the order of appearance of the base classes in the derived class base-specifier-list.

Then, direct base classes are initialized in declaration order as they appear in the base-specifier-list (regardless of the order of the mem-initializers).

Then, non-static data members are initialized in the order they were declared in the class definition (again regardless of the order of the mem-initializers).

Finally, the compound-statement of the constructor body is executed.

[Note:The declaration order is mandated to ensure that base and member subobjects are destroyed in the reverse order of initialization. —end note]
-----
Mind explaining the first sentence (In a non-delegating constructor...) and the first paragraph to me?
Report Abuse
NVI is not online. NVI
Joined: 11 Jan 2009
Total Posts: 4744
25 Jun 2012 07:31 PM
It means the destructor won't be called unless it's virtual in the base class. Have fun.
Report Abuse
Flurite is not online. Flurite
Joined: 03 Apr 2011
Total Posts: 5386
25 Jun 2012 09:34 PM
@NVI,

Err.. are you sure about that?
Report Abuse
eyeontheprizeREBOOT is not online. eyeontheprizeREBOOT
Joined: 30 Jan 2011
Total Posts: 1555
25 Jun 2012 09:35 PM
it means that the flux capacitor requires 1.21 jigawatts of electrical power to operate
Report Abuse
Flurite is not online. Flurite
Joined: 03 Apr 2011
Total Posts: 5386
26 Jun 2012 06:24 AM
*reads first sentence of original post*
*reads these posts*

. _ .
Report Abuse
SundownMKII is not online. SundownMKII
Joined: 26 Sep 2010
Total Posts: 12880
26 Jun 2012 06:27 AM
I worry about the brains of some of these people, Flurite.

~>dat siggy<~
Report Abuse
ENET is not online. ENET
Joined: 01 Jan 2010
Total Posts: 4820
26 Jun 2012 10:05 AM
It has to do with making sub classes and over-riding the base classes constructor and destructor function. If you don't have the base classes constructor and destructor function virtual you can't override it. Something like that....


You should look up virtual methods/functions before going directly to classes. But the virtual keyword is like saying "this is a method and the subclasses can change how it is called".... rather than saying "this method can't be changed by subclasses."
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image