I am trying to map a file to memory and then parse line by line- is istream what I should be using?
Is istream the same as mapping a file to memory on Windows? I have h
Is istream the same as mapping a file to memory on windows?
Not exactly. They are not the same in the same sense a "stream" is not a "file".
Think to a file as a stored sequence, and to a stream as the interface for the "channel" (a stream_buffer) that sequence flows when moving from its store towards the receiving variables.
Think to a memory mapped file as a "file" that -instead been stored outside the processing unit- is stored in-sync in memory. It has the advantage to be visible as a raw memory buffer being a file. If you want to read it as a stream, the simplest way is probably using a istringstream that has that raw buffer as the place to read from.