#1422 new todo

remove hack to patch the standard hash implementation

Reported by: Ichthyostega Owned by:
Priority: lesser Milestone: 1alpha
Component: lumiera Keywords: lib cleanup evolution
Sub Tickets: Parent Tickets: #722, #944

Description

As Lumiera Architect,
I want the hack related to std::hash to be re-assessed,
to avoid unnecessary technical liabilities.

explanation

A long time ago, an attempt was made to allow the standard hashing scheme from C++11 and the Boost-functional-hash to coexist, since the latter is much simpler to maintain. But then, an overly zealous implementation of the STL added a static assertion to »teach« people that they need to specialise std::hash in order to use a hashtable. Unfortunately, such an assertion and compilation failure defeats any attempt to insert a fall-back implementation, relying on SFINAE.

As a pragmatic workaround, we just patched the standard hash implementation with a macro. This hack works without much problems ever since, and thus it was forgotten. It is very likely that the problem with the assertion was resolved a long time ago — other people do similar things as we do...

the general situation

The situation related to hashing in the C++ standard is still unsatisfactory. The Committee spent a lot of time in discussions, but was not able to resolve those notorious inner contradictions: a language standard wants to be safe, it should work transparently without people having to care for minute details, yet the C++ community expects that the standard implementation never incurs unnecessary performance penalties. It seems, the only viable solution is actually not to provide a standard implementation — and this statement describes the status-quo fairly well, letting aside some trivial implementations for basic types.

Change history (0)

Note: See TracTickets for help on using tickets.