I have a large std::vector<X> where X is a structure with a serialize function for Boost.
I would like to serialize only part (a contiguous segment) of this vector in such a way that deserializing the result would give me an std::vector<X> with just the elements I serialized.
I can provide iterators pointing to the beginning and the end of the segment I want to serialize, or I can provide begin and end indices. Is there a way to do that without creating a smaller vector and copying the desired elements in it?
Note that I am using binary archives so any solution that would work only for this type of archive is fine.