tmp/tmpgg_c3sij/{from.md → to.md}
RENAMED
|
@@ -16,12 +16,12 @@ below. — *end note*]
|
|
| 16 |
A class is an *abstract class* if it has at least one pure virtual
|
| 17 |
function.
|
| 18 |
|
| 19 |
[*Note 3*: An abstract class can be used only as a base class of some
|
| 20 |
other class; no objects of an abstract class can be created except as
|
| 21 |
-
subobjects of a class derived from it
|
| 22 |
-
[[class.mem]]
|
| 23 |
|
| 24 |
A pure virtual function need be defined only if called with, or as if
|
| 25 |
with [[class.dtor]], the *qualified-id* syntax [[expr.prim.id.qual]].
|
| 26 |
|
| 27 |
[*Example 1*:
|
|
@@ -55,17 +55,18 @@ struct C {
|
|
| 55 |
|
| 56 |
[*Note 5*: An abstract class type cannot be used as a parameter or
|
| 57 |
return type of a function being defined [[dcl.fct]] or called
|
| 58 |
[[expr.call]], except as specified in [[dcl.type.simple]]. Further, an
|
| 59 |
abstract class type cannot be used as the type of an explicit type
|
| 60 |
-
conversion
|
| 61 |
-
[[expr.
|
| 62 |
-
|
| 63 |
-
|
|
|
|
| 64 |
|
| 65 |
-
A class is abstract if it
|
| 66 |
-
|
| 67 |
|
| 68 |
[*Example 3*:
|
| 69 |
|
| 70 |
``` cpp
|
| 71 |
class ab_circle : public shape {
|
|
@@ -92,11 +93,11 @@ would make class `circle` non-abstract and a definition of
|
|
| 92 |
`circle::draw()` must be provided.
|
| 93 |
|
| 94 |
— *end example*]
|
| 95 |
|
| 96 |
[*Note 6*: An abstract class can be derived from a class that is not
|
| 97 |
-
abstract, and a pure virtual function
|
| 98 |
which is not pure. — *end note*]
|
| 99 |
|
| 100 |
Member functions can be called from a constructor (or destructor) of an
|
| 101 |
abstract class; the effect of making a virtual call [[class.virtual]] to
|
| 102 |
a pure virtual function directly or indirectly for the object being
|
|
|
|
| 16 |
A class is an *abstract class* if it has at least one pure virtual
|
| 17 |
function.
|
| 18 |
|
| 19 |
[*Note 3*: An abstract class can be used only as a base class of some
|
| 20 |
other class; no objects of an abstract class can be created except as
|
| 21 |
+
subobjects of a class derived from it
|
| 22 |
+
[[basic.def]], [[class.mem]]. — *end note*]
|
| 23 |
|
| 24 |
A pure virtual function need be defined only if called with, or as if
|
| 25 |
with [[class.dtor]], the *qualified-id* syntax [[expr.prim.id.qual]].
|
| 26 |
|
| 27 |
[*Example 1*:
|
|
|
|
| 55 |
|
| 56 |
[*Note 5*: An abstract class type cannot be used as a parameter or
|
| 57 |
return type of a function being defined [[dcl.fct]] or called
|
| 58 |
[[expr.call]], except as specified in [[dcl.type.simple]]. Further, an
|
| 59 |
abstract class type cannot be used as the type of an explicit type
|
| 60 |
+
conversion
|
| 61 |
+
[[expr.static.cast]], [[expr.reinterpret.cast]], [[expr.const.cast]],
|
| 62 |
+
because the resulting prvalue would be of abstract class type
|
| 63 |
+
[[basic.lval]]. However, pointers and references to abstract class types
|
| 64 |
+
can appear in such contexts. — *end note*]
|
| 65 |
|
| 66 |
+
A class is abstract if it has at least one pure virtual function for
|
| 67 |
+
which the final overrider is pure virtual.
|
| 68 |
|
| 69 |
[*Example 3*:
|
| 70 |
|
| 71 |
``` cpp
|
| 72 |
class ab_circle : public shape {
|
|
|
|
| 93 |
`circle::draw()` must be provided.
|
| 94 |
|
| 95 |
— *end example*]
|
| 96 |
|
| 97 |
[*Note 6*: An abstract class can be derived from a class that is not
|
| 98 |
+
abstract, and a pure virtual function can override a virtual function
|
| 99 |
which is not pure. — *end note*]
|
| 100 |
|
| 101 |
Member functions can be called from a constructor (or destructor) of an
|
| 102 |
abstract class; the effect of making a virtual call [[class.virtual]] to
|
| 103 |
a pure virtual function directly or indirectly for the object being
|