On Saturday, 13 August 2016 at 11:09:05 UTC, Walter Bright wrote:
Taking the address of a ref variable has not been allowed in @safe code for a long time.

Which is understandable given things as they are, but which could probably be relaxed given good scope/lifetime analysis by the compiler...?

The above code is unsafe only if the lifetime of `data` outlives the lifetime of `input`. Surely the new scope rules should be able to distinguish the cases?
If that's already envisioned, how would that work?

That depends on how the instance of MyWrapperStruct is allocated. How did you intend to allocate it?

As a normal stack variable. Is that problematic? And if not, what would be problematic cases?
  • 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
              • ... Walter Bright via Digitalmars-d-announce
              • ... Mike via Digitalmars-d-announce
              • ... Rory McGuire via Digitalmars-d-announce

Reply via email to