On Sun, 04 Sep 2011 02:46:47 +0200, David Nadlinger <[email protected]> wrote:

As we currently aren't reviewing anything (We still need a review manager for David's RegionAllocator or whatever we decide to receive next? Do you want to get things going Jonathan? Should I do it again? Anybody else?), I thought I would take the opportunity to ask for comments on a few little template metaprogramming helpers:

https://gist.github.com/1191885

Besides a few helpers for manipulating/combining template predicates, the above link contains three main:

StaticFilter – like std.algorithm.filter, but for type tuples using template predicates. PApply – like the unluckily named std.functional.curry, but for template parameters
Compose - alias Compose!(A, B, C) Comp; // Comp!D is now A!(B!(C!D)).

I had originally whipped these up on the fly while working on some metaprogramming-heavy code, but they have proven useful in other projects as well. What do you think? Would some of these be worthy additions to Phobos? Do you have similar stuff lying around in your own code?

StaticFilter definitely should be in Phobos. StaticReduce too, but you
don't seem to have it on your list. I also often use StaticIota.

For more handy templates I feel should be in Phobos, see
Philippe Sigaud's dranges:

http://www.dsource.org/projects/dranges


--
  Simen

Reply via email to