Addison Wesley : C++ Gotchas: Avoiding Common Problems in Coding and Design by By

Addison Wesley : C++ Gotchas: Avoiding Common Problems in Coding and Design by By

Author:By
Language: eng
Format: epub
ISBN: 0-321-12518-5
Publisher: Addison Wesley
Published: 2011-10-03T15:18:51.542750+00:00


Gotcha #53: Virtual Base Default Initialization

A virtual base subobject is laid out differently from a nonvirtual base subobject. A nonvirtual base class is typically laid out as if it were a simple data member of a derived class object, as in Figure 5-1. It may therefore occur more than once within an object:

class A { members }; class B : public A { members }; class C : public A { members }; class D : public B, public C { members };

Figure 5-1. Likely object layout under multiple inheritance without virtual inheritance. A D object has two A subobjects.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.