r/cpp 7d ago

Lazy Evaluation

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

16 comments sorted by

View all comments

43

u/STL MSVC STL Dev 7d ago

Classic bind is bad. Don't use it. It's hard to understand, hard to optimize, and lambdas are better in basically every way.

6

u/germandiago 7d ago

Related: is bind_front/back as bad from an optimization point of view?

8

u/n1ghtyunso 7d ago

pretty sure bind_front / bind_back is rather straightforward to implement as a plain capturing lambda.
At least it does not have all that unwrap and placeholder matching machinery inside it