On Friday, 12 August 2016 at 12:01:41 UTC, Walter Bright wrote:
On 8/12/2016 4:12 AM, Joseph Rushton Wakeling wrote:
On Thursday, 11 August 2016 at 22:07:57 UTC, Walter Bright wrote:
The scheme does not implement borrowing. References to internal data should be returned via 'return ref' or 'return scope', where their usage will be limited
to the expression they appear in.

I want to make sure we have the same understanding here: the use-case I'm interested in is a data structure that needs to hold a reference to data it does not own -- where, obviously, the lifetime of the data structure cannot outlive
the lifetime of the data it references.

Surely this scope proposal ought to address that use-case?

Using ref counted objects should deal with that nicely.

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; I'd rather not have to choose between GC allocation or RC allocation (which I presume would both be on the heap...?). Or am I missing some of the potential uses of RC?
          • Re: DI... Timon Gehr via Digitalmars-d-announce
            • R... Walter Bright via Digitalmars-d-announce
  • 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

Reply via email to