DIP1000: The return of 'Extend Return Scope Semantics'
Dennis
dkorpel at gmail.com
Sat Jun 12 18:12:34 UTC 2021
On Saturday, 12 June 2021 at 08:23:10 UTC, Ola Fosheim Grøstad
wrote:
> Just a question: How will DIP1000 work with custom pointer
> types?
>
> As in, you don't want the lifetime of the pointer-object, but
> the pointed-to-object.
`scope` currently applies to the pointed-to-object. For structs,
it is applied to each member that is a type with pointers. For
`struct Ptr {int* ptr;}`, a `scope Ptr` is treated the same as a
`scope int*`. For `struct Handle { int handle; }`, a `scope
Handle` is treated like `scope int` (which gets its `scope`
stripped away because it has no pointers).
More information about the Digitalmars-d
mailing list