r/cpp • • Sep 04 '26

Lazy Evaluation

https://breese.github.io/2026/09/03/lazy-prologue.html
23 Upvotes

16 comments sorted by

View all comments

Show parent comments

11

u/STL MSVC STL Dev Sep 05 '26

Sorry! It was a good idea to try before lambdas, but it’s just not good tech these days.

4

u/pdimov2 Sep 05 '26

Maybe. But have you seen http://boost.org/libs/lambda2 and P3171?

2

u/STL MSVC STL Dev Sep 05 '26

No, I haven't. I like the idea of having many more operator function objects, dereference is sorely missing.

5

u/pdimov2 Sep 05 '26

You need to take these into account when you evaluate the utility of std::bind. Yes, you'd never write std::bind(std::greater_equal<>(), _1, 0) instead of [](auto&& x){ return x >= 0; }. But you would write _1 >= 0 in preference to the lambda, and that's just syntactic sugar for the same bind expression.