martinus / robin-hood-hashing

Fast & memory efficient hashtable based on robin hood hashing for C++11/14/17/20
https://gitter.im/martinus/robin-hood-hashing
MIT License
1.5k stars 142 forks source link

Please adding functional std (Windows) #95

Closed SanyaOs closed 3 years ago

SanyaOs commented 3 years ago

For the compatibility of my projects, I am missing a few features compared to std-libraries. For example: insert (with pair), increment iterator ( operator ++ ) , and other ...

martinus commented 3 years ago

robin_hood doesn't use std::pair, but you can easily use the map's value_type. Then your code is standard conform and works with both std::unordered_map and robin_hood maps.

operator++ is already there

SanyaOs commented 3 years ago

problem rewrite many source code (in old style :) ), i hope only change namespace in *.h file . operator ++ - you use prefix form (++i) , in my source postfix form (i++). and another problem in some source have reverse_iterator

martinus commented 3 years ago

Won't fix, as using std::pair would be a performance problem in some cases. There are plenty of standard conform alternatives that don't require hardcoded std::pair, you might also also use e.g. emplace.