Bug 8712 – There is no staticFilter in std.typetuple

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-09-23T10:26:00Z
Last change time
2015-06-09T05:13:44Z
Assigned to
nobody
Creator
void.unsigned

Comments

Comment #0 by void.unsigned — 2012-09-23T10:26:09Z
The standard module for type list manipulation there are metafunctions such as staticMap and ReplaceAll and EraseAll, but there is no staticFilter. staticFilter is good, because filter, like map is foundamental operation of functional-programming like lists. Also, it is more general-purpose: EraseAll can be implemented in terms of staticFilter. As a use-case, we may use the function as follows: alias staticFilter!(isInputRange, R1, R2, R3) InputRanges;
Comment #1 by bearophile_hugs — 2012-09-23T11:38:31Z
If you are willing to write the implementation, with ddocs and unittests, and set it as Phobos pull request, I think they will add it to Phobos. Especially if here you are able to list some other use cases coming from your code or from Phobos source code.
Comment #2 by issues.dlang — 2012-09-23T14:49:09Z
It's not in 2.060, but we have std.typetuple.Filter in the latest git which does this already.