click icon indicating copy to clipboard operation
click copied to clipboard

non-const `HashTable::operator[]` dies on failure to allocate

Open pallas opened this issue 8 years ago • 0 comments

If key is not in the table and allocation fails in find_insert, we return *NULL and the caller is likely to explode. Should this method return default_value() instead, like HashTable::operator[] const does? Since these templates do not use exceptions, it might actually be better to remove operator[] altogether and force folks to rely on ::find and ::find_insert.

pallas avatar Jul 07 '17 22:07 pallas