[Issue 7924] reduce does not work with immutable/const as map and filter do

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Feb 25 12:23:55 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=7924


monarchdodra at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |monarchdodra at gmail.com
         Resolution|                            |FIXED


--- Comment #2 from monarchdodra at gmail.com 2014-02-25 12:23:48 PST ---
immutable(Iota) is not a range => Requirements are that the argument is a
range.

The fact that map and filter accept const ranges is wrong to begin with. There
are cases where it is possible to strip the constness, but this is not always
the case. Doing a "dumb cast" could have some potentially crash-inducing
consequences.

It would be better to have a generic solution to this problem, instead of
hacking at it again and again in every implementations. So for now, let's just
leave this at "Not a range, sorry".

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list