http://d.puremagic.com/issues/show_bug.cgi?id=6110
Summary: std.functional: unaryFun should take an array alias.
Product: D
Version: future
Platform: Other
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Phobos
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from [email protected] 2011-06-05 15:55:36 PDT ---
I find myself writing code similar to the following quite a lot:
auto bbb = new bool[MAX];
auto arr = new int[MAX];
//...
writeln(filter!((a){return bbb[a];})(arr));
I think that it should be possible to do
writeln(filter!bbb(arr));
for the same effect.
It is generally useful to use an array as a function that maps integral indexes
to the element type of the array.
Therefore, I propose to improve unaryFun so that it implements the proposed
semantics.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------