diff --git a/source/overloading.tex b/source/overloading.tex index 8d565e6bad..b8e349ac8f 100644 --- a/source/overloading.tex +++ b/source/overloading.tex @@ -1466,8 +1466,8 @@ \begin{example} \begin{codeblock} template struct A { - explicit A(const T&, ...) noexcept; // \#1 - A(T&&, ...); // \#2 + explicit A(const T&, ...) noexcept; // \#1 + A(T&&, ...); // \#2 }; int i; @@ -1713,7 +1713,7 @@ }; int main() { - B b; // OK, \tcode{B::B()} + B b; // OK, \tcode{B::B()} } \end{codeblock} \end{example} @@ -2232,15 +2232,15 @@ \begin{codeblock} struct A { int x, y; }; struct B { int y, x; }; -void f(A a, int); // \#1 -void f(B b, ...); // \#2 -void g(A a); // \#3 -void g(B b); // \#4 +void f(A a, int); // \#1 +void f(B b, ...); // \#2 +void g(A a); // \#3 +void g(B b); // \#4 void h() { - f({.x = 1, .y = 2}, 0); // OK; calls \#1 - f({.y = 2, .x = 1}, 0); // error: selects \#1, initialization of \tcode{a} fails - // due to non-matching member order\iref{dcl.init.list} - g({.x = 1, .y = 2}); // error: ambiguous between \#3 and \#4 + f({.x = 1, .y = 2}, 0); // OK; calls \#1 + f({.y = 2, .x = 1}, 0); // error: selects \#1, initialization of \tcode{a} fails + // due to non-matching member order\iref{dcl.init.list} + g({.x = 1, .y = 2}); // error: ambiguous between \#3 and \#4 } \end{codeblock} \end{example} @@ -2271,24 +2271,24 @@ the context of a call to an initializer-list constructor. \begin{example} \begin{codeblock} void f(std::initializer_list); -f( {} ); // OK: \tcode{f(initializer_list)} identity conversion -f( {1,2,3} ); // OK: \tcode{f(initializer_list)} identity conversion -f( {'a','b'} ); // OK: \tcode{f(initializer_list)} integral promotion -f( {1.0} ); // error: narrowing +f( {} ); // OK: \tcode{f(initializer_list)} identity conversion +f( {1,2,3} ); // OK: \tcode{f(initializer_list)} identity conversion +f( {'a','b'} ); // OK: \tcode{f(initializer_list)} integral promotion +f( {1.0} ); // error: narrowing struct A { A(std::initializer_list); // \#1 A(std::initializer_list>); // \#2 A(std::initializer_list); // \#3 }; -A a{ 1.0,2.0 }; // OK, uses \#1 +A a{ 1.0,2.0 }; // OK, uses \#1 void g(A); -g({ "foo", "bar" }); // OK, uses \#3 +g({ "foo", "bar" }); // OK, uses \#3 typedef int IA[3]; void h(const IA&); -h({ 1, 2, 3 }); // OK: identity conversion +h({ 1, 2, 3 }); // OK: identity conversion \end{codeblock} \end{example} @@ -3304,9 +3304,9 @@ Z operator[](std::initializer_list); }; X x; -x[{1,2,3}] = 7; // OK: meaning \tcode{x.operator[](\{1,2,3\})} +x[{1,2,3}] = 7; // OK: meaning \tcode{x.operator[](\{1,2,3\})} int a[10]; -a[{1,2,3}] = 7; // error: built-in subscript operator +a[{1,2,3}] = 7; // error: built-in subscript operator \end{codeblock} \end{example}