Rationale for no opIndex, length in std.algorithm.map?

dsimcha dsimcha at yahoo.com
Wed May 13 05:58:11 PDT 2009

What is the rationale for lack of opIndex and length in map?  opIndex might be
a bad idea if the function being mapped is expensive, but it's not so bad if
the function is cheap.  Length just seems like a no-brainer to me if the
underlying range has a length.  There are several places in various code I've
written where I need to copy an arbitrary range, or some transform of it, to
an array, and this obviously can be done more efficiently when the length is
known in advance.  Were these just oversights, and should an enhancement
request be filed, or is there a good reason for excluding them?

More information about the Digitalmars-d mailing list