On 13.08.19 11:34, ikod wrote:
What is it?
cachetools - package with @safe and @nogc cache and containers
implementations.
[...]
Project page: https://github.com/ikod/cachetools
docs: https://ikod.github.io/cachetools/
They don't seem to actually be @safe. An example:
----
import cachetools.containers.lists;
import std.stdio;
void main() @safe
{
DList!int dl;
dl.insert_first(42);
auto r = dl.range;
dl.clear();
writeln(r.front); /* Prints garbage, because it's accessing `free`d
memory. */
}
----
As far as I can I see, that compiles because you have a bad @trusted
here:
<https://github.com/ikod/cachetools/blob/ac72aafe979e2f95a343eb9d19b1b67915e4fc17/source/cachetools/containers/lists.d#L391>.
Other containers probably have similar problems.