another episode of Coding Corner - PowerPoint PPT Presentation

1 / 7
About This Presentation
Title:

another episode of Coding Corner

Description:

Fatty f; Fatty, Base1, Base2, Thing1, Thing2. Fatty, Base1, ... Base2, Base1, Thing1, Thing2, Fatty. Base2, Base1, Thing2, Thing1, Fatty. Order of construction ... – PowerPoint PPT presentation

Number of Views:26
Avg rating:3.0/5.0
Slides: 8
Provided by: law82
Category:

less

Transcript and Presenter's Notes

Title: another episode of Coding Corner


1
another episode of Coding Corner
  • with Luke Wagner

2
What is the order of construction?
  • Fatty, Base1, Base2, Thing1, Thing2
  • Fatty, Base1, Base2, Thing2, Thing1
  • Base2, Base1, Thing1, Thing2, Fatty
  • Base2, Base1, Thing2, Thing1, Fatty
  • class Base1
  • class Base2
  • class Thing1
  • class Thing2
  • class Fatty Base2, private Base1
  • public
  • Fatty() Base1(), Base2(), two_(), one()
  • Thing1 one
  • private
  • Thing2 two_
  • Fatty f

3
Order of construction
1 left to right, depth first
class X B1, B2, B3, B4 A a B b C c
X()
2 top to bottom, depth first
3 class
almost
4
wow, thats so simpleeven I can do it
5
Im not finished! Haduken!!
(Broken Health)
6
and virtual inheritance
  • a few more complications, but essentially, they
    are constructed before all else, left to right
  • read more on forum post tonight

7
Why important?
  • When bases or members depend on each other
  • Cooperates with exception handling
  • Good to know what the compiler writes for you
Write a Comment
User Comments (0)
About PowerShow.com