Serializing a beginning/ending iterator range

std::vector<char>::iterator begin_iter, end_iter;

// ...

o_iter.range(begin_iter, end_iter);

The output iterator defines a range() method that takes two random access iterators, a beginning iterator and an ending iterator to the same container, and serializes just the container subset that's specified by this iterator range.


range() only works with random access iterators, so its application is limited to std::vector and std::basic_string.