[Issue 22272] [std.range.retro] should behave the same as foreach_reverse

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Sep 3 20:27:49 UTC 2021


Dlang Bot <dlang-bot at dlang.rocks> changed:

           What    |Removed                     |Added
           Keywords|                            |pull

--- Comment #1 from Dlang Bot <dlang-bot at 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
  it accepts Ranges that have valid 'popBack', 'back', and 'empty' functions.
  'retro' Range, on the other hand, forces the user to implement 'front',
  'popFront', and 'save' functions as well because it follows the Range
  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 at gmail.com>



More information about the Digitalmars-d-bugs mailing list