The missing bit in DIP1000

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Thu Jun 23 11:39:57 UTC 2022


> the full type would be:
>
> ```d
> (scope(int)|heap(int)|null)* p;
> ```

It might be better to use something like this instead:

```d
(scope(int)|nonlocal(int)|null)* p;
```

As you might later want to distinguish between globalstatic, 
malloc-heap and gc-heap.

So you get:

- returnscope <: scope
- globalstatic <: nonlocal
- mallocheap <: nonlocal
- gcheap <: nonlocal

Where globalstatic is the same lifetime as the program.

Or something along these lines.

Note that C++ also defines types that are not directly 
expressible by name in the language to describe move semantics, 
so the above does not suggest syntax, just desirable semantics.



More information about the Digitalmars-d mailing list