Skip to content

hash_numeric fails is_monoid_for_v required for count() #70

@csheinlen

Description

@csheinlen

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();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions