]> www.ginac.de Git - ginac.git/blobdiff - ginac/hash_seed.h
Finalized 1.6.3 release.
[ginac.git] / ginac / hash_seed.h
index 32b057fba4671090624e81432ed9b7d44bbda447..6cf65acb67269fa49a950449b1114d15331acc2e 100644 (file)
@@ -1,5 +1,19 @@
+/** @file hash_seed.h
+ *
+ * Type-specific hash seed. */
+
 #ifndef GINAC_HASH_SEED_H
 #define GINAC_HASH_SEED_H
+
+#include <typeinfo>
+#include <cstring>
+#include "crc32.h"
+#include "utils.h"
+#ifdef _WIN32
+#define GINAC_HASH_USE_MANGLED_NAME 1
+#endif
+namespace GiNaC
+{
 /**
  * We need a hash function which gives different values for objects of
  * different types. Hence we need some unique integer for each type.
  * collisions (and slower evaluation as a result), but being a bit slower
  * is much better than being wrong.
  */
-#include <typeinfo>
-#include <cstring>
-#include "crc32.h"
-#include "utils.h"
-#ifdef _WIN32
-#define GINAC_HASH_USE_MANGLED_NAME 1
-#endif
-namespace GiNaC
-{
 #ifndef GINAC_HASH_USE_MANGLED_NAME
 static inline unsigned make_hash_seed(const std::type_info& tinfo)
 {
-       // this pointer is the same for all objects of the same type.
-       // Hence we can use that pointer 
+       // This pointer is the same for all objects of the same type.
+       // Hence we can use it.
        const void* mangled_name_ptr = (const void*)tinfo.name();
        unsigned v = golden_ratio_hash((p_int)mangled_name_ptr);
        return v;