tmp/tmp8nvum6_9/{from.md → to.md}
RENAMED
|
@@ -2,16 +2,17 @@
|
|
| 2 |
|
| 3 |
When an argument is an initializer list [[dcl.init.list]], it is not an
|
| 4 |
expression and special rules apply for converting it to a parameter
|
| 5 |
type.
|
| 6 |
|
| 7 |
-
If the initializer list is a *designated-initializer-list*
|
| 8 |
-
is
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
|
|
|
| 13 |
|
| 14 |
[*Note 10*:
|
| 15 |
|
| 16 |
Aggregate initialization does not require that the members are declared
|
| 17 |
in designation order. If, after overload resolution, the order does not
|
|
@@ -67,11 +68,11 @@ f( {1,2,3} ); // OK, f(initializer_list<int>) identity convers
|
|
| 67 |
f( {'a','b'} ); // OK, f(initializer_list<int>) integral promotion
|
| 68 |
f( {1.0} ); // error: narrowing
|
| 69 |
|
| 70 |
struct A {
|
| 71 |
A(std::initializer_list<double>); // #1
|
| 72 |
-
A(std::initializer_list<complex<double>>);
|
| 73 |
A(std::initializer_list<std::string>); // #3
|
| 74 |
};
|
| 75 |
A a{ 1.0,2.0 }; // OK, uses #1
|
| 76 |
|
| 77 |
void g(A);
|
|
|
|
| 2 |
|
| 3 |
When an argument is an initializer list [[dcl.init.list]], it is not an
|
| 4 |
expression and special rules apply for converting it to a parameter
|
| 5 |
type.
|
| 6 |
|
| 7 |
+
If the initializer list is a *designated-initializer-list* and the
|
| 8 |
+
parameter is not a reference, a conversion is only possible if the
|
| 9 |
+
parameter has an aggregate type that can be initialized from the
|
| 10 |
+
initializer list according to the rules for aggregate initialization
|
| 11 |
+
[[dcl.init.aggr]], in which case the implicit conversion sequence is a
|
| 12 |
+
user-defined conversion sequence whose second standard conversion
|
| 13 |
+
sequence is an identity conversion.
|
| 14 |
|
| 15 |
[*Note 10*:
|
| 16 |
|
| 17 |
Aggregate initialization does not require that the members are declared
|
| 18 |
in designation order. If, after overload resolution, the order does not
|
|
|
|
| 68 |
f( {'a','b'} ); // OK, f(initializer_list<int>) integral promotion
|
| 69 |
f( {1.0} ); // error: narrowing
|
| 70 |
|
| 71 |
struct A {
|
| 72 |
A(std::initializer_list<double>); // #1
|
| 73 |
+
A(std::initializer_list<std::complex<double>>); // #2
|
| 74 |
A(std::initializer_list<std::string>); // #3
|
| 75 |
};
|
| 76 |
A a{ 1.0,2.0 }; // OK, uses #1
|
| 77 |
|
| 78 |
void g(A);
|