On 9/27/14, 12:50 PM, Dmitry Olshansky wrote:
27-Sep-2014 23:14, Andrei Alexandrescu пишет:
On 9/27/14, 2:38 AM, Dmitry Olshansky wrote:

Okay it serves no good for me to make these tiny comments while on the
go.

As usual, structs are value types, so this feature can be mis-used, no
two thoughts abouts it. It may need a bit of improvement in
user-friendliness, compiler may help there by auto-detecting common
misuse.

I still don't understand what "this feature" is after reading your long
post twice.

So structs are still value types and you replace postblit/destroy with
calls to opInc/opDec? That's it? How does this enable anything more
interesting than ctors/dtors?


Compiler is aware that opInc and opDec are indeed ref-countinng ops,
meaning that opInc + opDec = no op. I claim that this is enough to get
"ARC" going.

You give marginal details but still don't describe the thing. When are they called and what do they have that ctors/dtors/postblit don't?

FWIW the language always "understands" when to elide postblit/dtor calls.


Andrei


Reply via email to