Skip to content

Commit 35aa22a

Browse files
committed
[expr.prim.id.unqual] Fix parameter name in example ("y", not "z")
The misspelling was a misapplication of the motion paper P2579R0. Also harmonize the local use of whitespace.
1 parent 89df45a commit 35aa22a

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

source/expressions.tex

+9-6
Original file line numberDiff line numberDiff line change
@@ -1513,6 +1513,7 @@
15131513
\begin{codeblock}
15141514
void f() {
15151515
float x, &r = x;
1516+
15161517
[=]() -> decltype((x)) { // lambda returns \tcode{float const\&} because this lambda is not \tcode{mutable} and
15171518
// \tcode{x} is an lvalue
15181519
decltype(x) y1; // \tcode{y1} has type \tcode{float}
@@ -1522,14 +1523,16 @@
15221523
return y2;
15231524
};
15241525

1525-
[=](decltype((x)) y){
1526+
[=](decltype((x)) y) {
15261527
decltype((x)) z = x; // OK, \tcode{y} has type \tcode{float\&}, \tcode{z} has type \tcode{float const\&}
15271528
};
1528-
[=]{
1529-
[](decltype((x)) y){}; // OK, lambda takes a parameter of type \tcode{float const\&}
1530-
[x=1](decltype((x)) z){
1531-
decltype((x)) z = x; // OK, \tcode{y} has type \tcode{int\&}, \tcode{z} has type \tcode{int const\&}
1532-
};
1529+
1530+
[=] {
1531+
[](decltype((x)) y) {}; // OK, lambda takes a parameter of type \tcode{float const\&}
1532+
1533+
[x=1](decltype((x)) y) {
1534+
decltype((x)) z = x; // OK, \tcode{y} has type \tcode{int\&}, \tcode{z} has type \tcode{int const\&}
1535+
};
15331536
};
15341537
}
15351538
\end{codeblock}

0 commit comments

Comments
 (0)