tmp/tmpf79p2chf/{from.md → to.md}
RENAMED
|
@@ -1,25 +1,27 @@
|
|
| 1 |
#### Initialization by list-initialization <a id="over.match.list">[[over.match.list]]</a>
|
| 2 |
|
| 3 |
When objects of non-aggregate class type `T` are list-initialized such
|
| 4 |
that [[dcl.init.list]] specifies that overload resolution is performed
|
| 5 |
-
according to the rules in this
|
| 6 |
-
|
|
|
|
| 7 |
|
| 8 |
-
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
|
|
|
|
|
|
| 15 |
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
an `explicit` constructor is chosen, the initialization is ill-formed.
|
| 19 |
|
| 20 |
-
[*Note 1*: This differs from other situations
|
| 21 |
[[over.match.copy]]), where only converting constructors are considered
|
| 22 |
for copy-initialization. This restriction only applies if this
|
| 23 |
initialization is part of the final result of overload
|
| 24 |
resolution. — *end note*]
|
| 25 |
|
|
|
|
| 1 |
#### Initialization by list-initialization <a id="over.match.list">[[over.match.list]]</a>
|
| 2 |
|
| 3 |
When objects of non-aggregate class type `T` are list-initialized such
|
| 4 |
that [[dcl.init.list]] specifies that overload resolution is performed
|
| 5 |
+
according to the rules in this subclause or when forming a
|
| 6 |
+
list-initialization sequence according to [[over.ics.list]], overload
|
| 7 |
+
resolution selects the constructor in two phases:
|
| 8 |
|
| 9 |
+
- If the initializer list is not empty or `T` has no default
|
| 10 |
+
constructor, overload resolution is first performed where the
|
| 11 |
+
candidate functions are the initializer-list constructors
|
| 12 |
+
[[dcl.init.list]] of the class `T` and the argument list consists of
|
| 13 |
+
the initializer list as a single argument.
|
| 14 |
+
- Otherwise, or if no viable initializer-list constructor is found,
|
| 15 |
+
overload resolution is performed again, where the candidate functions
|
| 16 |
+
are all the constructors of the class `T` and the argument list
|
| 17 |
+
consists of the elements of the initializer list.
|
| 18 |
|
| 19 |
+
In copy-list-initialization, if an explicit constructor is chosen, the
|
| 20 |
+
initialization is ill-formed.
|
|
|
|
| 21 |
|
| 22 |
+
[*Note 1*: This differs from other situations ([[over.match.ctor]],
|
| 23 |
[[over.match.copy]]), where only converting constructors are considered
|
| 24 |
for copy-initialization. This restriction only applies if this
|
| 25 |
initialization is part of the final result of overload
|
| 26 |
resolution. — *end note*]
|
| 27 |
|