DIP1000: Scoped Pointers
Walter Bright via Digitalmars-d-announce
digitalmars-d-announce at puremagic.com
Thu Aug 11 15:03:02 PDT 2016
On 8/11/2016 6:38 AM, Sönke Ludwig wrote:
> What would be nice to add is a behavior specification for 'scope' member
> variables (lifetime considered equal or slightly shorter than parent object
> lifetime). For example the `RefCountedSlice.payload` and `count` fields could be
> annotated with 'scope' to let the compiler actually guarantee that they won't be
> accessible in a way that conflicts with their lifetime (i.e. the 'scope' return
> of 'opIndex' would actually be enforced).
That adds a fair amount of complication I haven't worked through.
More information about the Digitalmars-d-announce
mailing list