Safe Regions with Deterministic Destruction

Per Nordlöw per.nordlow at gmail.com
Mon Oct 26 14:27:49 UTC 2020


This is an interesting read:

https://cyclone.thelanguage.org/wiki/Region%20Common%20Uses/

The typical use case I see is a tree `T` that `emplace`s all its 
nodes in a region `R` where `R`'s lifetime and, in turn, `T`s 
nodes are all deterministically bound to `T`s lifetime.

Can such a tree be written today with the help of DIP-1000 and 
`@live`?

That provides @safe `scope`d access to its nodes in -dip1000.

And would a potential solution differ in implementation depending 
on whether the node is a value (POD or `struct`) or a reference 
type (`class` or pointer)?


More information about the Digitalmars-d mailing list