scoped classes

Alex via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Apr 27 13:20:37 PDT 2017


On Thursday, 27 April 2017 at 19:18:14 UTC, Stanislav Blinov 
wrote:
> On Thursday, 27 April 2017 at 18:36:08 UTC, Alex wrote:
>
> move() is only destructive if the type has custom postblit or 
> destructor, otherwise it's just a bitwise copy. But, as 
> mentioned, there's an issue with it at the moment: it doesn't 
> really care if the type being moved has const/immutable members.
>
> uninitializedArray is scary. If you do use it, probably best to 
> localize the usage as much as possible and be very very VERY 
> careful with it ;)
:-)
>
> Here's a sketch of something that's a little bit more 
> convenient: https://dpaste.dzfl.pl/ee472fd872a5
> But I'm not going to pretend it'd survive a review.
Wow! So much work already done... Thanks for so much ideas :)

>
> Also note that, going back to your original question, docs for 
> scoped state that it's illegal to move it, so that particular 
> type you can't really store in any of these arrays.
yeah... At the beginning of the day, I thought, this would act as 
a wrapper, which could simplify things... just a wrong direction.


More information about the Digitalmars-d-learn mailing list