Solved by glaringlee in post #2 
              
              
                @dfalbel see my comment in the following code. You can also check c++ reference for std::istream_iterator. 
std::ifstream input_stream("ivalue.pt");

// a. You need this line, otherwise istream_iterator will skip all the whitespace in the file
//     which will skip characters when reading "ivalue.p…