[Issue 8371] Add a function to make a range from a sequence of elements

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jul 10 13:46:38 PDT 2012


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


Christophe Travert <christophe.travert at normalesup.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |christophe.travert at normales
                   |                            |up.org


--- Comment #2 from Christophe Travert <christophe.travert at normalesup.org> 2012-07-10 13:46:35 PDT ---
I'm not sure how should support slicing. The most economic way to implement
this range is to use a static array and an index indicated the next value.
Slicing this range would require either:
 - to store an extra index in the range... that would be sad IMHO, because it
is often not needed.
 - to return something else than a "range":
   - a struct containing the static array and the slice. That seems to be
overkill.
   - a dynamic array. Then the slice would not be a value type like the range
is.

The dynamic array option is the most reasonable to me.

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