Mistake with bind in "The C++ Programming Language [4th Edition] - Bjarne Stroustrup"

Viewed 1364

I found this code in Bjarne Stroustrup's book: Page screenshot

The problem with this code is that variable i does not stay at 2, it is incremented to 3. You can check it here: https://wandbox.org/permlink/p5JC1nOA4pIpsgXb

We do not have to use the std::ref() to increment this variable. Is it a mistake in the book or something has been changed since C++11?

1 Answers
Related