![]() |
aGrUM
0.20.3
a C++ library for (probabilistic) graphical models
|
This class enables to safely define hash functions for types that may or may not already has defined hash functionsThere are types that are defined differently depending on the architecture or the compiler you use. More...
#include <agrum/tools/core/hashFunc.h>
This class enables to safely define hash functions for types that may or may not already has defined hash functions
There are types that are defined differently depending on the architecture or the compiler you use.
This is the case, for instance, of std::size_t which is defined as an unsigned long by gcc and clang on 64 bits architectures, but is defined as an unsigned int in 32 bits architectures by theses compilers, and it is defined neither as an unsigned long nor as an unsigned int by Visual Studio 15 MVSC on 64 bits architectures. To enable to define the hash function of std::size_t appropriately in all these cases, instead of defining directly a HasHunc of <std::size_t>, it is sufficient to define a HashFunc of <HashFuncConditionalType<std::size_t,unsigned int,unsigned long>::type>. The latter will actually define a HasHunc of <std::size_t> if size_t corresponds neither to an unsigned int nor to an unsigned long, else it will not define the HasHunc of <std::size_t> (which would redefine an already defined HashFunc, hence resulting in a compilation failure).
Definition at line 407 of file hashFunc.h.