skarupke / flat_hash_map

A very fast hashtable
1.69k stars 186 forks source link

Missing end(size_t n) form of iterator? #13

Open madscientist opened 6 years ago

madscientist commented 6 years ago

I made a quick attempt to add this into my codebase as a drop-in replacement for std::unordered_map. Mostly it worked fine but there were a few errors. I haven't tracked them all down, but one of them is:

         for (TableMap::local_iterator it = tables.begin(bucket); it != tables.end(bucket); it++) {
              ^~~~~~~~
 ...
     const_iterator end() const
                    ^~~
ska/bytell_hash_map.hpp:402:20: note:   candidate expects 0 arguments, 1 provided

It's trying to use this form of end() from http://www.cplusplus.com/reference/unordered_map/unordered_map/end/

local_iterator end (size_type n); const_local_iterator end (size_type n) const;

Thanks!

cebtenzzre commented 5 years ago

Based on the description of unordered_map's bucket interface on cppreference, it looks bucket_size and the related form of begin() also need to be implemented.