I found this code in Bjarne Stroustrup's book:

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?