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

HashSet with class nothrow #43

Closed
burner opened this issue Apr 12, 2016 · 5 comments
Closed

HashSet with class nothrow #43

burner opened this issue Apr 12, 2016 · 5 comments
Assignees
Labels
Milestone

Comments

@burner
Copy link
Contributor

burner commented Apr 12, 2016

I'm trying to put a class into a HashSet but it keeps telling me something are not nothrow even though the code I created is nothrow. Maybe it's to late right now or I'm just stupid. Anyway, I could need some help.

import containers.hashset;

import std.experimental.allocator.mallocator : Mallocator;

private hash_t stringToHash(string str) @safe pure nothrow @nogc {
    hash_t hash = 5381;
    return hash;
}

hash_t FooToHash(Foo e) pure @safe nothrow @nogc {
    return stringToHash(e.name);
}

class Foo {
    string name;
}

void main() {
    HashSet!(Foo, Mallocator, FooToHash) hs;
}
@Hackerpilot
Copy link
Contributor

Looks like I need to remove some nothrow attributes from the containers because Object's methods aren't annotated properly.

@Hackerpilot Hackerpilot self-assigned this Apr 12, 2016
burner added a commit to burner/containers that referenced this issue Apr 13, 2016
* testing most containers with classes
@burner
Copy link
Contributor Author

burner commented Apr 13, 2016

I created a PR fixing the issue and added some more testing.

  • Are you guys come to DConf?
  • If this passes your review and the CI could you create a new release soon. I really need a hashset and would like to include it through code.dlang.org. No pressure ;-)

burner added a commit to burner/containers that referenced this issue Apr 13, 2016
* testing most containers with classes

tab to whitespace
Hackerpilot added a commit that referenced this issue Apr 13, 2016
@Hackerpilot Hackerpilot added this to the v0.4.2 milestone Apr 13, 2016
@Hackerpilot
Copy link
Contributor

I won't be coming to DConf this year. I'd say more about it but these Github issues are visible to the entire world.

@Hackerpilot
Copy link
Contributor

@burner
Copy link
Contributor Author

burner commented Apr 13, 2016

thanks, that was fast

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

No branches or pull requests

2 participants