On 08/24/2013 10:01 AM, Kinkie wrote:
> Hi all,
>   I'm looking into some refactoring activity while I'm waiting for
> some merge reviews to be completed, and by idly browsing the code I
> crossed paths with hash_table.
> 
> I was about to code a c++ templatized wrapper, but then I started
> wondering what is the advantage of hash_table versus
> std::unordered_map?

hash_table does not require C++11 support in the compiler and, at least
in theory, does not have unknown compatibility problems with Squid code
(such as frequently hitting worst-case search or update scenarios).

On the other hand, hash_table does not work well with C++ objects.


> Would it be useful to refactor from one to the other while waiting
> such as now?

Do all compilers we care about support std::unordered_map?

If yes, switching to a standard, C++-friendly class would be useful.
However, there are other, more useful projects available if you are
looking for something fun to do (and new code can use std::unordered_map
if you declare it supported).


HTH,

Alex.


Reply via email to