
On Thu, Jan 7, 2010 at 4:56 PM, Daniel Colascione <daniel@censorshipresearch.org> wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 1/7/10 6:25 AM, Mathias Gaunard wrote:
Daniel Colascione wrote:
Iterating over the first and second elements of a collection of pairs is a pretty common problem. Would it be possible to get something like the following into boost?
Isn't that a trivial application of transform_iterator?
Sure, it can be implemented via transform_iterator too. And it is a trivial application. But it serves two purposes:
1) provides commonly-needed functionality with only a little additional code
2) provides examples for library users -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (Darwin)
iEYEARECAAYFAktGWKoACgkQ17c2LVA10VsawgCgj1TBlPOLeIoaxub541hdxVWY FFMAoJovYYwOPtseJlDbCxGUOVr+jlfK =3w8v -----END PGP SIGNATURE-----
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
FWIW, I've implemented exactly this tool in the codebase at work, using the transform_iterator technique. I've also written an analogous tool which extracts a particular element from each element in a collection of boost::tuples. I'd have been happy to see either or both as part of boost, or at least as examples in the iterator library. -Gabe