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

hash_numeric fails is_monoid_for_v required for count() #70

Open
csheinlen opened this issue Feb 2, 2024 · 0 comments
Open

hash_numeric fails is_monoid_for_v required for count() #70

csheinlen opened this issue Feb 2, 2024 · 0 comments

Comments

@csheinlen
Copy link

I took the code from your hashtable tests and added a final call to count(). Without that last line it compiles without any issue, but including table.count() triggers this assertion failure:

include/parlay/internal/sequence_ops.h:192:17: error: static assertion failed
  192 |   static_assert(is_monoid_for_v<Monoid, range_reference_type_t<Seq>>);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
int main(int argc, char* argv[]) {

    parlay::hashtable<parlay::hash_numeric<int>>
    table(400000, parlay::hash_numeric<int>{});;

    parlay::parallel_for(1, 100000, [&](int i) {
      table.insert(i);
    });

    size_t cnt = table.count();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant