Allocator-aware @safe reference counting is still not possible

Paul Backus snarwin at gmail.com
Sat Feb 4 17:28:35 UTC 2023


On Saturday, 4 February 2023 at 11:33:18 UTC, patescross wrote:
> I'm pretty much convinced we need isolated. This is very 
> similar to why the language as it exists today doesn't allow a 
> library author to write a vector type that can be appended to, 
> which... is the main reason one would use a vector to begin 
> with.

Actually, Timon Gehr has pointed out a clever way that this can 
be done in library code, using the newly-added 
-preview=systemVariables feature:

https://forum.dlang.org/post/tr9j1h$1fvd$1@digitalmars.com

Doing this makes the allocator API quite ugly and cumbersome to 
work with, but as Richard Cattermole pointed out in his earlier 
messages, most users should not have to work with allocators 
directly.


More information about the Digitalmars-d mailing list