If the object of the exercise is just to ouput some sub_part of the original vector - then
there is no need to make new vectors - just set a vector_iterator ( lets call it pv1) to the first element, loop until pv1+x (where x is the number of elements required to output).
However, if you really want to create a second vector then you have no choice but to copy.
(I'm waiting...)
NOTE: certainly in the context of an ostream iterator, the copy function does not actually make
a copy (it doesn't need to) - it just does the usual ostream << object thing.
Thanks guestgulkan. Of course, my example is simple for clarity.
So I am back to arrays.
Thought, to clarify my need : I want to create a big hash table class that will be loaded in shared memory with a lot of methods using side tables of different sizes. So I want these tables to be stored in a continuous array of memory.