containers icon indicating copy to clipboard operation
containers copied to clipboard

support for @safe

Open ikod opened this issue 6 years ago • 3 comments

Hello,

I'd like to use containers in @safe code, but, for example

cannot call @system function containers.unrolledlist.UnrolledList!(int, Mallocator, false, 64LU).UnrolledList.popFront

Is there something I can do with this or any chances to have @safe contaners?

Thanks!

ikod avatar Jun 30 '18 17:06 ikod

I can solve this by adding @safe where I can and @trusted otherwise.

GabyForceQ avatar Nov 09 '18 08:11 GabyForceQ

Hello,

Thanks, would be nice.

Btw, I have @safe, @nogc hashmap which performs better in my tests.

ikod avatar Nov 11 '18 07:11 ikod

For many operations we have the same problem as #60, the attribute would need to be inferred from other user-supplied code we call (allocator, hash function...). Of course, the method list would need to be very carefully scrutinized to check which ones have an actual @safe interface. (I suppose returning pointers/references to anything inside the container would be generally unsafe, for example.)

CyberShadow avatar Sep 18 '21 11:09 CyberShadow