Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for @safe #115

Open
ikod opened this issue Jun 30, 2018 · 3 comments
Open

support for @safe #115

ikod opened this issue Jun 30, 2018 · 3 comments

Comments

@ikod
Copy link

ikod commented Jun 30, 2018

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!

@GabyForceQ
Copy link

GabyForceQ commented Nov 9, 2018

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

@ikod
Copy link
Author

ikod commented Nov 11, 2018

Hello,

Thanks, would be nice.

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

@CyberShadow
Copy link
Member

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants