On 8/12/2016 5:54 AM, Joseph Rushton Wakeling wrote:
On Friday, 12 August 2016 at 12:51:26 UTC, Joseph Rushton Wakeling wrote:
I'm not sure I follow.  I'm looking for the ability to guarantee that a
pointer to a stack-allocated entity will not go out of scope

... more precisely, that the pointer will not become invalid because the data it
points to goes out of scope.


That's just what this DIP addresses.

    struct MyWrapperStruct (T)
    {
        private T* data;

        public this (ref T input)
        {
this.data = &input; // error: not allowed to take address of ref variable
        }
    }

The DIP does not add ownership annotations or semantics.
  • Re: DIP1000: Scoped Poi... Sönke Ludwig via Digitalmars-d-announce
  • Re: DIP1000: Scoped Poi... Joseph Rushton Wakeling via Digitalmars-d-announce
    • Re: DIP1000: Scope... Joseph Rushton Wakeling via Digitalmars-d-announce
    • Re: DIP1000: Scope... Walter Bright via Digitalmars-d-announce
      • Re: DIP1000: S... Joseph Rushton Wakeling via Digitalmars-d-announce
        • Re: DIP100... Walter Bright via Digitalmars-d-announce
          • Re: DI... Joseph Rushton Wakeling via Digitalmars-d-announce
            • R... Joseph Rushton Wakeling via Digitalmars-d-announce
              • ... Walter Bright via Digitalmars-d-announce
              • ... Joseph Rushton Wakeling via Digitalmars-d-announce
              • ... Walter Bright via Digitalmars-d-announce
              • ... Joseph Rushton Wakeling via Digitalmars-d-announce
              • ... Walter Bright via Digitalmars-d-announce
              • ... Joseph Rushton Wakeling via Digitalmars-d-announce
              • ... Walter Bright via Digitalmars-d-announce
              • ... Guillaume Chatelet via Digitalmars-d-announce
              • ... Joseph Rushton Wakeling via Digitalmars-d-announce
              • ... Walter Bright via Digitalmars-d-announce
              • ... Mike via Digitalmars-d-announce

Reply via email to