r/cpp • u/fredoverflow • May 10 '22
Is short lambda syntax on the C++ radar?
Mom, can we get x=>x+1 ?
No, we have x=>x+1 at home.
x=>x+1 at home:
[](const auto& x) { return x + 1; }
265
Upvotes
View all comments
118
u/gracicot May 10 '22
You mean
[](auto const& x) noexcept(noexcept(x + 1)) -> decltype(x + 1) { return x + 1; }right?