File tree 1 file changed +9
-6
lines changed
1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change 1513
1513
\begin {codeblock }
1514
1514
void f() {
1515
1515
float x, &r = x;
1516
+
1516
1517
[=]() -> decltype((x)) { // lambda returns \tcode {float const\& } because this lambda is not \tcode {mutable} and
1517
1518
// \tcode {x} is an lvalue
1518
1519
decltype(x) y1; // \tcode {y1} has type \tcode {float}
1522
1523
return y2;
1523
1524
};
1524
1525
1525
- [=](decltype((x)) y){
1526
+ [=](decltype((x)) y) {
1526
1527
decltype((x)) z = x; // OK, \tcode {y} has type \tcode {float\& }, \tcode {z} has type \tcode {float const\& }
1527
1528
};
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
+ };
1533
1536
};
1534
1537
}
1535
1538
\end {codeblock }
You can’t perform that action at this time.
0 commit comments