562760 (2) [Avatar] Offline
#1
Hi,

I am following the code listings in chapter 1. I am seeing this line in listing 1.2

in.unsetf(std::ios_base::skipws);

Do you know why it is necessary for reading the file? Is there any alternatives?

Thanks
Ivan Cukic (97) [Avatar] Offline
#2
Hmh, this means they haven't updated the 1st chapter in the MEAP. I hope they will finish the print preparation soon as this is a bit ridiculous.

the unsetf thing was meant to make the stream not skip spaces while reading. After, I switched the implementation to istreambuf_iterator which behaves correctly when reading characters.
562760 (2) [Avatar] Offline
#3
That works! Thank you. It looks like the gitlab repo also needs to be updated.