The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

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 (104) [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.