Register
Site Login
Site Search
Forums
Advertisement
Welcome to PocketMatrix. PocketMatrix is dedicated to providing the best online community for mobile device developers and enthusiests. What's new?

C++ Iterator Question


C++ Iterator Question

Postby Andy » Apr 20, 2006 @ 4:54pm

I'm looking for an iterator adapter that will allow me to glue together two (or more) disjoint iterator ranges. Something like this:

Code: Select all









10 
11 
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 }
11 lines; 3 keywds; 9 nums; 31 ops; 0 strs; 3 coms    Syntactic Coloring v0.4 - Dan East  


Is there such a thing?
Andy
<font color=red size=3>Troll++</font>
 
Posts: 1288
Joined: Nov 1, 2003 @ 7:36am


Postby Kzinti » Apr 20, 2006 @ 6:04pm

Nothing like that built into the language or standard library.

You will have to right your own. Shouldn't be too hard.
Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron