Skip to content

Commit

Permalink
[over] Minor horizontal whitespace adjustment for comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tkoeppe committed Oct 3, 2017
1 parent bcb8316 commit 94ef282
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions source/overloading.tex
Expand Up @@ -1466,8 +1466,8 @@
\begin{example}
\begin{codeblock}
template <class T> struct A {
explicit A(const T&, ...) noexcept; // \#1
A(T&&, ...); // \#2
explicit A(const T&, ...) noexcept; // \#1
A(T&&, ...); // \#2
};

int i;
Expand Down Expand Up @@ -1713,7 +1713,7 @@
};

int main() {
B b; // OK, \tcode{B::B()}
B b; // OK, \tcode{B::B()}
}
\end{codeblock}
\end{example}
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -2271,24 +2271,24 @@
the context of a call to an initializer-list constructor. \begin{example}
\begin{codeblock}
void f(std::initializer_list<int>);
f( {} ); // OK: \tcode{f(initializer_list<int>)} identity conversion
f( {1,2,3} ); // OK: \tcode{f(initializer_list<int>)} identity conversion
f( {'a','b'} ); // OK: \tcode{f(initializer_list<int>)} integral promotion
f( {1.0} ); // error: narrowing
f( {} ); // OK: \tcode{f(initializer_list<int>)} identity conversion
f( {1,2,3} ); // OK: \tcode{f(initializer_list<int>)} identity conversion
f( {'a','b'} ); // OK: \tcode{f(initializer_list<int>)} integral promotion
f( {1.0} ); // error: narrowing

struct A {
A(std::initializer_list<double>); // \#1
A(std::initializer_list<complex<double>>); // \#2
A(std::initializer_list<std::string>); // \#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}

Expand Down Expand Up @@ -3304,9 +3304,9 @@
Z operator[](std::initializer_list<int>);
};
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}

Expand Down

0 comments on commit 94ef282

Please sign in to comment.