Base Classes
The inheritance process creates a new derived class that is made up of the members of the base class(es) plus any new members added by the derived class. In a multiple-inheritance, it is possible to construct an inheritance graph where the same base class is part of more than one of the derived classes. The following figure shows such a graph.
Multiple instances of a single base class
In the figure, pictorial representations of the components of CollectibleString
and CollectibleSortable
are shown. However, the base class, Collectible
, is in CollectibleSortableString
through the CollectibleString
path and the CollectibleSortable
path. To eliminate this redundancy, such classes can be declared as virtual base classes when they are inherited.
Tilbakemeldinger
https://aka.ms/ContentUserFeedback.
Kommer snart: Gjennom 2024 faser vi ut GitHub Issues som tilbakemeldingsmekanisme for innhold, og erstatter det med et nytt system for tilbakemeldinger. Hvis du vil ha mer informasjon, kan du se:Send inn og vis tilbakemelding for