Skip to content

Commit c98f946

Browse files
authored
Nits for "Multiple Base Classes" topic
1 parent 4032d5a commit c98f946

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎docs/cpp/multiple-base-classes.md‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ A class can be derived from more than one base class. In a multiple-inheritance
1111
```cpp
1212
// deriv_MultipleBaseClasses.cpp
1313
// compile with: /LD
14-
class Collection {
15-
};
14+
class Collection {};
1615
class Book {};
1716
class CollectionOfBook : public Book, public Collection {
1817
// New members
@@ -26,7 +25,7 @@ The order in which base classes are specified isn't significant except in certai
2625
- The order in which destructors are invoked to clean up. Again, if a particular "part" of the class must be present when the other part is being destroyed, the order is significant. Destructors are called in the reverse order of the classes specified in the *base-list*.
2726
2827
> [!NOTE]
29-
> The order of specification of base classes can affect the memory layout of the class. Do not make any programming decisions based on the order of base members in memory.
28+
> The order of specification of base classes can affect the memory layout of the class. Do not make any programming decisions based on the order of base members in memory.
3029
3130
When specifying the *base-list*, you can't specify the same class name more than once. However, it's possible for a class to be an indirect base to a derived class more than once.
3231
@@ -188,7 +187,7 @@ Explicit and implicit conversions from pointers or references to class types can
188187
189188
- The declaration of an object of type `D`.
190189
191-
- The effect of applying the address-of operator (**&**) to that object. The address-of operator always supplies the base address of the object.
190+
- The effect of applying the address-of operator (`&`) to that object. The address-of operator always supplies the base address of the object.
192191
193192
- The effect of explicitly converting the pointer obtained using the address-of operator to the base-class type `A`. Coercing the address of the object to type `A*` doesn't always provide the compiler with enough information as to which subobject of type `A` to select; in this case, two subobjects exist.
194193

0 commit comments

Comments
 (0)