February 01, 2023

On Wednesday, 1 February 2023 at 17:46:17 UTC, Atila Neves wrote:

>

On Saturday, 28 January 2023 at 15:56:54 UTC, Nick Treleaven wrote:

>

Working code:
https://github.com/ntrel/stuff/blob/master/typecons/isolated.d

Isolated could go in std.typecons.

I don't understand how this presents a @safe interface.

See Timon's last post for demonstration.

February 04, 2023
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.
February 04, 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.
1 2 3 4 5 6 7
Next ›   Last »