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

deadalnix deadalnix at gmail.com
Wed Nov 10 17:24:03 UTC 2021


On Wednesday, 10 November 2021 at 17:09:05 UTC, H. S. Teoh wrote:
> Isn't that what @disable this() is for?
>
> And to be pedantic, the object *was* constructed -- by the 
> default ctor. If you didn't want that, you should @disable 
> this().
>
>
> T

No.

Everything that is destructed must have been constructed. It is 
the only way you can enforce invariant within a type.


More information about the Digitalmars-d mailing list