[Issue 24601] New: [next edition] Make opApply result opaque
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Wed Jun 12 07:49:43 UTC 2024
    
    
  
https://issues.dlang.org/show_bug.cgi?id=24601
          Issue ID: 24601
           Summary: [next edition] Make opApply result opaque
           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
I take issue with the fact that `opApply` has the signature `int opApply(int
delegate(…))`. The `int` part makes little sense.
It would be preferable to have a type (defined in object.d) named
`OpApplyResult` (which can be a wrapped `int`) and have `opApply` specified to
be: `OpApplyResult opApply(OpApplyResult delegate(…))`
That makes clear that the result of the delegate is to be returned.
--
    
    
More information about the Digitalmars-d-bugs
mailing list