The non-intrusive ad-hoc borrowing scheme…

Nick Treleaven nick at geany.org
Fri Nov 22 15:32:14 UTC 2019


On Wednesday, 20 November 2019 at 06:40:50 UTC, Ola Fosheim 
Grøstad wrote:
> But maybe it could be configured in a more granular manner than 
> on/off.

Do you have any ideas on that?

One nice thing is that the struct doesn't need to expose an 
element by ref unless the user needs to pass it as a ref argument 
to some function.

Instead, the struct can define opIndexAssign and opIndexOpAssign, 
which don't need to bump the reference count. I probably didn't 
get that far with my proof of concept RCSlice.


More information about the Digitalmars-d mailing list