Safe Regions with Deterministic Destruction

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Tue Oct 27 21:41:43 UTC 2020


On Tuesday, 27 October 2020 at 19:13:28 UTC, ag0aep6g wrote:
> I didn't understand what you mean by "passing as a class". I 
> guess you mean that it returns a class.

Oh, bad wording on my part. I meant "dressed up as a class".

> Ok, I see your point now. I wasn't thinking about `scope` as an 
> indicator for stack allocation at all. As far as I'm aware 
> that's just a possible optimization, not a guarantee.

Ah! I thought it was a feature. :-)

> It's fairly obvious to me that `scope` is not easy to 
> understand. The buggy implementation and insufficient 
> documentation don't help. At the same time, I am myself not 
> interested in finding a better solution to the problem.

I think it is interesting to think about what the consequences 
would be if it was transitive. Basically: anything reached 
through this variable is scoped.



More information about the Digitalmars-d mailing list