This nags at me a bit too: http://stackoverflow...answer-5165293
Things to point out and quote from there would be:
"EDIT #2: I've found that the slow down for me was due to the set insert"
"Which gives a slowdown of a whooping 17%.
This takes into account:
automatic memory management (no buffer overflow)
automatic resources management (no risk to forget to close the file)
handling of locale"
Unless you deal with a huge text file, 17% are nothing compared to what you get in return and once you manually do the equivalent, chances are your own code would be as "slow" or even slower.