I don't want any boost dependency or anything external. I could read the file line by line, and process each line separately. But if it works better, I can also load the whole file in memory, and process it line by line afterwards.
What's the best approach? Also, what is the fastest approach, how do they differ?
Also, this should both work with a regular text file, and piping a file through terminal.