[Issue 24647] New: Non copyable types can’t do postfix increment/decrement

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jul 3 17:20:10 UTC 2024


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

          Issue ID: 24647
           Summary: Non copyable types can’t do postfix
                    increment/decrement
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: qs.il.paperinik at gmail.com

While technically, `x++` means `x` is copied and the copy isn’t used, for
non-copyable types, that means `x++` can’t compile. Maybe allow postfix
increment for non-copyable types if the result isn’t used and make it mean
`++x` (which is what it means for copyable types).

--


More information about the Digitalmars-d-bugs mailing list