I very often use the std::istream_iterator or std::ostream_iterator for IO-activities for my classes. For that I overwrite the extractor and insert
std::istream_iterator
std::ostream_iterator