IMHO, general rule should be this:
read_{format} accepts std::basic_istream
write_{format} accepts std::basic_ostream
On the other hand, I quite like the iterator-based interface of Boost.Spirit
and I think it would be easier to flip the idea over:
- provide I/O interfaces based on iterators
- allow users to pass streams through iterators
instead of passing complete stream objects.
Iterators are good for generalisation of both containers and streams.
Bruno, what do you think?