[Issue 6110] New: std.functional: unaryFun should take an array alias.
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Jun 5 16:00:05 PDT 2011
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: nobody at puremagic.com
ReportedBy: timon.gehr at gmx.ch
--- Comment #0 from timon.gehr at gmx.ch 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: -------
More information about the Digitalmars-d-bugs
mailing list