Boost logo

Boost :

From: Thomas Witt (witt_at_[hidden])
Date: 2002-11-19 09:30:19


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Herve,

On Tuesday 19 November 2002 07:11, Herve Bronnimann wrote:
> Dave, Jeremy: one iterator adaptor I needed often (and once again today)
> is the projection on the first or second member of a pair. I could make
> it using projection_iterator<> and select1st, except that select1st is
> an std extension from SGI. I haven't found any other out-of-the-box way
> to do this, did I miss something?

Not as far as I can see.

As a sidenote. From my experience you will run into the projection/transform
problem quite frequently. IIRC projection iterators cannot be used on base
iterators that don't have real reference types.

>
> I find them especially useful in connection with map::iterator, since
> std::map does not have a value_iterator. I guess that alone provides the
> rationale for including such an iterator adaptor, not to mention better
> support of std::pair.

Actually, I'd like to see a more general solution for all kind of tuple like
types.

Smth like

typedef select_iterator<0, std::map<int>::iterator > key_iterator_t;

Btw, templated typedefs anybody ?

>
> It's simple enough to make two adaptors, so if you don't see anything
> wrong with it, I'm proposing the patch for you. I'll even write the
> corresponding portion of the documentation if you go ahead with it.
> Hope you like it,

I like the idea, and yes I do believe there is a real need. There are just
some issues to be sorted out. I'd like to postpone this until the new
iterator_adaptor version is finished.

Thanks

Thomas

- --
Dipl.-Ing. Thomas Witt
Institut fuer Verkehrswesen, Eisenbahnbau und -betrieb, Universitaet Hannover
voice: +49(0) 511 762 - 4273, fax: +49(0) 511 762-3001
http://www.ive.uni-hannover.de
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE92kr/0ds/gS3XsBoRAquxAJ4yr6ZLp/LRhxjYDyW6bZHrqrpYBgCeO7E+
b7Ebbr85gMKFXrqBFqFMr/E=
=u8Oq
-----END PGP SIGNATURE-----


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk