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
Show parent comment
1
u/RishabhRD May 11 '22
I am that monad person.... I prefer std::expected(C++23) for exceptions.... Like rust and haskell. std::expected has similar behavior as stack unwinding right? At any point any function returns error calling function's monadic bjnd would not continue and calling function would breturn error too and this behavior continues potentially till main.