[hash]
Add basic support for hashing using Dune::hash This patch introduces the functor Dune::hash in a similar manner to other C++11 functionality by importing the definition from namespace std. Apart from that, the patch also provides some basic functionality to simplify making user-defined types hashable, in particular functions for combining hashes and hashing iterator ranges as well as a mechanism for defining the struct specializations required by std::hash and std::tr1::hash in the correct namespace. The current implementation will first try to use std::hash and, if that fails, attempt to fall back on std::tr1::hash. If that is not available either, hash support is disabled as there is no homegrown fallback for now. The extension mechanism will register the type with both std::hash and std::tr1::hash, if available. This should make it possible to use unordered_{set,map} from both C++11 and TR1 without having to specify a custom hasher. Kudos to Steffen Müthing, see FS#1192 [[Imported from SVN: r7065]]
dune/common/hash.hh
0 → 100644
Please register or sign in to comment