#347 closed todo (done)

Itertools

Reported by: Ichthyostega Owned by: Ichthyostega
Priority: lesser Milestone: 1alpha
Component: lumieraSteam Keywords: lib
Sub Tickets: #182, #475, #491 Parent Tickets: #283, #675, #874, #1119, #1420

Description

Start a collection of Iterator-tools, similar to the Python module, or the Commons-Collections IteratorUtils, or the respective features of Groovy.

Of course we're not writing a library, so we'll add here what is needed, starting with

  • a filtered iterator
  • a transform iterator

Possibly also (if not too difficult to implement)

  • a chain iterator
  • a dropwhile

Change history (13)

comment:1 by Ichthyostega, at 2009-11-02T05:01:39Z

Status: newaccepted

did the first steps here, due to the ContentsQuery, which can be implemented quite elegantly with a filter on top of the scope enumeration capability of the PlacementIndex

comment:2 by Ichthyostega, at 2009-11-13T02:30:10Z

implemented an transform iterator, allowing to define PlacementIndex::iterator in terms of an transformer and a range yielded from the embedded hashtable

comment:3 by Ichthyostega, at 2009-12-21T01:37:11Z

blockedby: 182182, 475

comment:4 by Ichthyostega, at 2009-12-21T01:38:03Z

blocking: 283

comment:5 by Ichthyostega, at 2010-01-03T04:11:17Z

blockedby: 182, 475182, 475, 486

comment:6 by Ichthyostega, at 2010-01-05T01:26:37Z

blockedby: 182, 475, 486182, 475, 486, 491

comment:7 by Ichthyostega, at 2010-01-06T05:19:29Z

added caching to FilterIter, implemented duplicate-filtering iterator

comment:8 by Ichthyostega, at 2010-04-02T21:19:36Z

blockedby: 182, 475, 486, 491182, 475, 491

(In #486) ugly, but not an urgent problem right now. Pushing to future

comment:9 by Ichthyostega, at 2010-04-02T21:20:01Z

Resolution: done
Status: acceptedclosed

The basics are implemented and have proven to be very helpful already. Leaving the extensions to be done on demand.

comment:10 by Ichthyostega, at 2010-10-05T02:21:09Z

blocking: 283283, 675

comment:11 by Ichthyostega, at 2011-12-18T00:59:34Z

blocking: 283, 675283, 675, 874

comment:12 by Undercover Agent, at 2025-12-25T00:00:00Z

blockedby: 182, 475, 491
blocking: 283, 675, 874
Parent Tickets: 283, 675, 874
Sub Tickets: 182, 475, 491

Migration MasterTickets ⟼ Subtickets-plugin

comment:13 by Ichthyostega, at 2026-04-09T19:55:01Z

Parent Tickets: 283, 675, 874283, 675, 874, 1119, 1420

Last days I made a complete overhaul, basically a rewrite of this frequently-used library header. The rationale is to minimise the overlap with IterExplorer — the »Itertools« are now considered the simple lightweight variant and preferred in cases where using the full-fledged pipeline builder framework seems like overkill. Another motivation was the fact that the »sandwich design« employed in the old implementation looked clumsy and dated; especially the fact that a specialised tool class must be instantiated and then moved into the base wrapper was found to be problematic and occasionally caused some correctness problems, especially when lambdas with reference-closure were bound.

The new design is oriented towards being inlineable, by avoiding the opaque std::function adapter and rather incorporating the nested functor directly.

Note: See TracTickets for help on using tickets.