On 05.03.2019 2:01, r-const-dev wrote:
Thanks, seems that using dataPoints[] makes dataPoints usable as an
range. How can I learn more about [] operator? I'm not sure I understand
how is this documented in DList.
dataPoints is an aggregate type variable, not a range and slice operator
opSlice/[] returns a range of this aggregate type. I have no appropriate
links unfortunately but these can be useful
https://dlang.org/phobos/std_container_dlist.html#.DList.opSlice - this
operator returns a range
https://dlang.org/phobos/std_container_dlist.html#.DList.Range - this is
range that allows to iterate over DList elements
http://ddili.org/ders/d.en/ranges.html - intro to ranges
Find does the job! What's the difference between find and until?
`find` returns a range that starts from the key
`until` returns a range of all elements before the key
https://run.dlang.io/is/1kpOUx
P.S. `findSplit` returns three ranges, first one contains all elements
before the key like `until`, second range contains all elements that are
equal to the key and third range contains the rest