[Issue 9582] std.algorithm.map!(T) cause CT error for fixed size arrays

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Feb 24 08:11:53 PST 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9582


monarchdodra at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |monarchdodra at gmail.com


--- Comment #3 from monarchdodra at gmail.com 2013-02-24 08:11:52 PST ---
(In reply to comment #2)
> This is by design. map expects an input range. Static arrays are not input
> ranges. You have to take a slice.
> 
> auto ms = map!"a*a"(smt[]); // note additional []
> 
> reduce only requires an iterable, which includes static arrays.

...and this is good example of why accepting an "iterable" as a function
argument, as opposed to a range, is usually a bad idea.

As for reduce accepting iterable, Andrei asked me to remove it in one of my
open requests, so don't expect it keep working for too long.

https://github.com/D-Programming-Language/phobos/pull/861#discussion_r2024457

-- 
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