On 2/28/15 7:01 PM, Manu via Digitalmars-d wrote:
On 1 March 2015 at 12:51, Andrei Alexandrescu via Digitalmars-d
<digitalmars-d@puremagic.com> wrote:
On 2/28/15 6:49 PM, Manu via Digitalmars-d wrote:

On 1 March 2015 at 12:21, Andrei Alexandrescu via Digitalmars-d
<digitalmars-d@puremagic.com> wrote:

On 2/28/15 5:43 PM, Manu via Digitalmars-d wrote:


I'd like to see a struct with RC operators have implicit calls
generated (and elided) for exactly the same set of cases as classes,
in terms of construction/destruction/assignment/passing to/from
functions.



The short answer is that probably won't happen. -- Andrei


*sigh* ... ever, or in DIP74?


In the foreseeable future.

I presented my 80% case to you before. I just want this to work
efficiently:

extern(C) void inc(void*);
extern(C) void dec(void*);

struct X
{
    void *thing;

    opInc() { inc(thing); }
    opDec() { dec(thing); }
}


struct X
{
   void *thing;

   this(this) { inc(thing); }
   ~this() { dec(thing); }
}

You've conveniently ignored the word 'efficient'.

Inserting calls to opAddRef and opRelease, and the rules that allow their elision, follow quite closely (albeit not 100% identically) the rules for inserting calls to copy constructors and destructors.

Okay, so if I'm not better off then I've always been, what is the good
of DIP74 to me?

The title reads "Reference Counted Class Objects".


Andrei

Reply via email to