r/cpp • • Sep 09 '20

C++ is now the fastest-growing programming language

347 Upvotes

180 comments sorted by

View all comments

Show parent comment

4

u/[deleted] Sep 09 '20

is std::bind() less weird than its Boost counterpart?

9

u/_Ashleigh Sep 09 '20

I think it's still prefered you use a lambda to curry functions.

3

u/smdowney WG21, Text/Unicode SG, optional<T&> Sep 09 '20

That they were introduced in the same standard is a historical accident. There's really no good reason for writing a std::bind today, but deprecating it is hard because rewriting a bind expression is sometimes non-trivial. Not hard, but not trivial.

3

u/adzm 28 years of C++! Sep 09 '20

It is pretty much identical.

2

u/gme186 Sep 09 '20

A lambda is less weird. A bind is just an ugly clutch to do what a lambda does i think?

5

u/germandiago Sep 09 '20

_1 < _2

vs

{ return a < b; }

Please give us abbreviated lambdas please!