[Issue 24481] retro no longer works with types that support assignment but not moving

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Apr 29 09:33:37 UTC 2024


https://issues.dlang.org/show_bug.cgi?id=24481

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from Dlang Bot <dlang-bot at dlang.rocks> ---
dlang/phobos pull request #8969 "Fix bugzilla issue 24481: retro stopped
working" was merged into stable:

- f66f2b22a69005f7a1ba9ea40a7ad814d840ef36 by Jonathan M Davis:
  Fix bugzilla issue 24481: retro stopped working

  In an attempt make it so that non-copyable types worked with some of the
  functions in std/range/package.d, they were made to use moves instead of
  assignment, which broke the code for types which work with assignment
  but not moves (which affected the folks at Weka).

  The code checked for assignment but not whether move could be used, and
  that didn't change when the code was changed to use move, meaning that
  the checks didn't match what the code was actually doing.

  So, to support both the non-copyable types and the ones that can be
  assigned to but not moved to, this changes the code to use
  core.lifetime.forward which will move the argument if it can and assign
  otherwise. So ,the code that worked previously should work again, and
  the newer functionality of being able to use non-copyable types with
  this code should continue to work.

  Discussion here: https://github.com/dlang/phobos/pull/8721

https://github.com/dlang/phobos/pull/8969

--


More information about the Digitalmars-d-bugs mailing list