tmp/tmpeyaf20g4/{from.md → to.md}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
### Initialization by inherited constructor <a id="class.inhctor.init">[[class.inhctor.init]]</a>
|
| 2 |
|
| 3 |
When a constructor for type `B` is invoked to initialize an object of a
|
| 4 |
-
different type `D` (that is, when the constructor was inherited
|
| 5 |
-
[[namespace.udecl]])
|
| 6 |
constructor were used to initialize the `D` object and each base class
|
| 7 |
subobject from which the constructor was inherited, except that the `B`
|
| 8 |
subobject is initialized by the invocation of the inherited constructor.
|
| 9 |
The complete initialization is considered to be a single function call;
|
| 10 |
in particular, the initialization of the inherited constructor’s
|
|
@@ -85,11 +85,11 @@ struct V2 : virtual B { using B::B; };
|
|
| 85 |
struct D2 : V1, V2 {
|
| 86 |
using V1::V1;
|
| 87 |
using V2::V2;
|
| 88 |
};
|
| 89 |
|
| 90 |
-
D1 d1(0); //
|
| 91 |
D2 d2(0); // OK: initializes virtual B base class, which initializes the A base class
|
| 92 |
// then initializes the V1 and V2 base classes as if by a defaulted default constructor
|
| 93 |
|
| 94 |
struct M { M(); M(int); };
|
| 95 |
struct N : M { using M::M; };
|
|
|
|
| 1 |
### Initialization by inherited constructor <a id="class.inhctor.init">[[class.inhctor.init]]</a>
|
| 2 |
|
| 3 |
When a constructor for type `B` is invoked to initialize an object of a
|
| 4 |
+
different type `D` (that is, when the constructor was inherited
|
| 5 |
+
[[namespace.udecl]]), initialization proceeds as if a defaulted default
|
| 6 |
constructor were used to initialize the `D` object and each base class
|
| 7 |
subobject from which the constructor was inherited, except that the `B`
|
| 8 |
subobject is initialized by the invocation of the inherited constructor.
|
| 9 |
The complete initialization is considered to be a single function call;
|
| 10 |
in particular, the initialization of the inherited constructor’s
|
|
|
|
| 85 |
struct D2 : V1, V2 {
|
| 86 |
using V1::V1;
|
| 87 |
using V2::V2;
|
| 88 |
};
|
| 89 |
|
| 90 |
+
D1 d1(0); // error: ambiguous
|
| 91 |
D2 d2(0); // OK: initializes virtual B base class, which initializes the A base class
|
| 92 |
// then initializes the V1 and V2 base classes as if by a defaulted default constructor
|
| 93 |
|
| 94 |
struct M { M(); M(int); };
|
| 95 |
struct N : M { using M::M; };
|