mardi 15 août 2017

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

I found this code in Bjarne Stroustrup's book: http://ift.tt/2vGjWxw

The problem with this code is that variable 'i' does not stay to be 2, it stays to be 3. You can check it here: http://ift.tt/2vYZV81

We do not have to use std::ref() to increment this variable.

Is it a mistake in the book or something has been changed since C++11?

Aucun commentaire:

Enregistrer un commentaire