| |
 | Posted by Dlang Bot | Permalink Reply |
|
Dlang Bot 
| https://issues.dlang.org/show_bug.cgi?id=22272
Dlang Bot <dlang-bot@dlang.rocks> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |pull
--- Comment #1 from Dlang Bot <dlang-bot@dlang.rocks> ---
@iK4tsu created dlang/phobos pull request #8231 "Fix std.range.retro not behaving the same as foreach_reverse" fixing this issue:
- std.range: fix function 'save' to only be implemented if the Range is has a valid 'save' method
The 'retro' Range only does one thing, iterates a Range back to front. This
follows the same semantics as a 'foreach_reverse'. However, with
'foreach_reverse'
it accepts Ranges that have valid 'popBack', 'back', and 'empty' functions.
The
'retro' Range, on the other hand, forces the user to implement 'front',
'popFront', and 'save' functions as well because it follows the Range
hierarchy.
For a Range that only iterates back to front, accomplishing the same as the
'foreach_reverse', it should behave the same way.
Fixes Issue #22272
Signed-off-by: João Lourenço <jlourenco5691@gmail.com>
https://github.com/dlang/phobos/pull/8231
--
|