breadthFirstFoldLeft

higher order function for fold left via breadth-fisrt search

breadthFirstFoldLeft
(
alias func
Accumulator
Ts...
)
(
Accumulator acc
,
auto ref Ts ts
)

Examples

breadth-first map iterates by top-to-bottom search.

enum t = tuple(1,
               tuple(
                     tuple(
                           4,
                           tuple(
                                 7)),
                     2),
               tuple(
                     3,
                     tuple(
                           5,
                           6)));
static assert(breadthFirstFoldLeft!((a, b) => tuple(a.expand, b))(tuple(), t) == tuple(1, 2, 3, 4, 5, 6, 7));

Meta