DIP1000: Walter's proposal to resolve ambiguity of ref-return-scope parameters

Dennis dkorpel at gmail.com
Thu Nov 25 16:22:32 UTC 2021


On Thursday, 25 November 2021 at 15:05:55 UTC, zjh wrote:
> I usually use `C++`,`C++` has no similar `scope`,`C++` has 
> `RAII`.

The idea of `scope` is allowing `@safe` access to raw 
pointers/arrays with limited lifetime. RAII in C++ doesn't do 
anything to protect basic types like that.

> It would be nice if `d` had some `symbols/sugar syntax` to 
> simplify these attributes.

What are you thinking of? If `return scope` and `return ref` used 
symbols such as `^%` and `^$` (for example), that wouldn't make 
it simpler.


More information about the Digitalmars-d mailing list