tmp/tmpw2pqu6w1/{from.md → to.md}
RENAMED
|
@@ -17,24 +17,23 @@ struct complex {
|
|
| 17 |
complex(double,double);
|
| 18 |
};
|
| 19 |
|
| 20 |
complex sqrt(complex,complex);
|
| 21 |
|
| 22 |
-
complex a(1); //
|
| 23 |
-
complex b = a; //
|
| 24 |
-
complex c = complex(1,2); //
|
| 25 |
-
|
| 26 |
-
complex
|
| 27 |
-
complex
|
| 28 |
-
complex
|
| 29 |
-
complex g = { 1, 2 }; // initialize by a call of complex(double, double)
|
| 30 |
```
|
| 31 |
|
| 32 |
— *end example*]
|
| 33 |
|
| 34 |
-
[*Note 1*: Overloading of the assignment operator
|
| 35 |
-
|
| 36 |
|
| 37 |
An object of class type can also be initialized by a *braced-init-list*.
|
| 38 |
List-initialization semantics apply; see [[dcl.init]] and
|
| 39 |
[[dcl.init.list]].
|
| 40 |
|
|
|
|
| 17 |
complex(double,double);
|
| 18 |
};
|
| 19 |
|
| 20 |
complex sqrt(complex,complex);
|
| 21 |
|
| 22 |
+
complex a(1); // initialized by calling complex(double) with argument 1
|
| 23 |
+
complex b = a; // initialized as a copy of a
|
| 24 |
+
complex c = complex(1,2); // initialized by calling complex(double,double) with arguments 1 and 2
|
| 25 |
+
complex d = sqrt(b,c); // initialized by calling sqrt(complex,complex) with d as its result object
|
| 26 |
+
complex e; // initialized by calling complex()
|
| 27 |
+
complex f = 3; // initialized by calling complex(double) with argument 3
|
| 28 |
+
complex g = { 1, 2 }; // initialized by calling complex(double, double) with arguments 1 and 2
|
|
|
|
| 29 |
```
|
| 30 |
|
| 31 |
— *end example*]
|
| 32 |
|
| 33 |
+
[*Note 1*: Overloading of the assignment operator [[over.ass]] has no
|
| 34 |
+
effect on initialization. — *end note*]
|
| 35 |
|
| 36 |
An object of class type can also be initialized by a *braced-init-list*.
|
| 37 |
List-initialization semantics apply; see [[dcl.init]] and
|
| 38 |
[[dcl.init.list]].
|
| 39 |
|