I'm looking for an iterator adapter that will allow me to glue together two (or more) disjoint iterator ranges. Something like this:
Is there such a thing?
- Code:
int a1[] = { 1, 3, 5 };
int a2[] = { 2, 4, 6 };
disjoint_iterator it<int>(a1, a1 + 3,
a2, a2 + 3);
sort(it, it + 6);
// results:
// a1 == { 1, 2, 3 }
// a2 == { 4, 5, 6 }
Is there such a thing?