Challenge: write a reference counted slice that works as much as possible like a built-in slice

RazvanN razvan.nitu1305 at gmail.com
Wed Dec 15 08:29:17 UTC 2021


On Wednesday, 15 December 2021 at 08:27:25 UTC, RazvanN wrote:
> On Tuesday, 14 December 2021 at 12:14:52 UTC, Tejas wrote:
>
>>   [...]
>
> This has come up in the past and typically folks have agreed 
> that once you used void initialization it is your problem to 
> make sure that the object is valid before destruction. I, 
> personally, do not agree with that; since you are bypassing 
> construction, you should also bypass destruction, however, an 
> argument can be made for both sides.
>
> My perspective is that currently you have an easy way to bypass 
> destruction but you need to do the union trick to bypass 
> destruction. I would vote for having a dip that would somehow 
> make it easy to express the intent that you want to avoid 
> destruction for a specific object.

Typo! The first sentence of the last paragraph should be: "My 
perspective is that currently you have an easy way to bypass
construction but you need to do the union trick to bypass 
destruction"


More information about the Digitalmars-d mailing list