From 2668b42d2991e7a414a984fb5d7d3a38223d43c9 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sat, 22 Mar 2025 20:35:15 +0100 Subject: [PATCH] Separating tl::hfunc from std namespace. Needed to support int128 in tl::Variant for 64bit coordinate builds. --- src/db/db/dbAsIfFlatRegion.cc | 4 +- src/db/db/dbHash.h | 352 ++++++++++++++-------------- src/db/db/dbPropertiesRepository.cc | 2 +- src/db/db/dbShape.cc | 6 +- src/db/db/gsiDeclDbBox.cc | 2 +- src/db/db/gsiDeclDbCell.cc | 2 +- src/db/db/gsiDeclDbEdge.cc | 2 +- src/db/db/gsiDeclDbEdgePair.cc | 2 +- src/db/db/gsiDeclDbLayout.cc | 2 +- src/db/db/gsiDeclDbPath.cc | 2 +- src/db/db/gsiDeclDbPoint.cc | 2 +- src/db/db/gsiDeclDbPolygon.cc | 4 +- src/db/db/gsiDeclDbText.cc | 2 +- src/db/db/gsiDeclDbTrans.cc | 4 +- src/db/db/gsiDeclDbVector.cc | 2 +- src/tl/tl/tlHash.h | 209 +++++++++-------- src/tl/tl/tlVariant.cc | 50 ++-- 17 files changed, 338 insertions(+), 311 deletions(-) diff --git a/src/db/db/dbAsIfFlatRegion.cc b/src/db/db/dbAsIfFlatRegion.cc index 339af0235..1ea27bb98 100644 --- a/src/db/db/dbAsIfFlatRegion.cc +++ b/src/db/db/dbAsIfFlatRegion.cc @@ -53,7 +53,7 @@ struct ResultCountingInserter { typedef db::Polygon value_type; - ResultCountingInserter (std::unordered_map > &result) + ResultCountingInserter (std::unordered_map > &result) : mp_result (&result) { // .. nothing yet .. @@ -70,7 +70,7 @@ struct ResultCountingInserter } private: - std::unordered_map > *mp_result; + std::unordered_map > *mp_result; }; } diff --git a/src/db/db/dbHash.h b/src/db/db/dbHash.h index 0770b03b4..7daa982c5 100644 --- a/src/db/db/dbHash.h +++ b/src/db/db/dbHash.h @@ -55,7 +55,7 @@ namespace db * for use with std::unordered_map and std::unordered_set */ -namespace std +namespace tl { inline size_t hfunc_coord (db::DCoord d) { @@ -89,15 +89,6 @@ namespace std return hfunc_coord (o.x (), hfunc_coord (o.y ())); } - template - struct hash > - { - size_t operator() (const db::point &o) const - { - return hfunc (o); - } - }; - /** * @brief Hash value for a vector */ @@ -114,15 +105,6 @@ namespace std return hfunc_coord (o.x (), hfunc_coord (o.y ())); } - template - struct hash > - { - size_t operator() (const db::vector &o) const - { - return hfunc (o); - } - }; - /** * @brief Hash value for a box */ @@ -139,15 +121,6 @@ namespace std return hfunc (o.p1 (), hfunc (o.p2 ())); } - template - struct hash > - { - size_t operator() (const db::box &o) const - { - return hfunc (o); - } - }; - /** * @brief Hash value for an edge */ @@ -164,15 +137,6 @@ namespace std return hfunc (o.p1 (), hfunc (o.p2 ())); } - template - struct hash > - { - size_t operator() (const db::edge &o) const - { - return hfunc (o); - } - }; - /** * @brief Hash value for an edge pair */ @@ -189,15 +153,6 @@ namespace std return hfunc (o.lesser (), hfunc (o.greater (), hfunc (int (o.is_symmetric ())))); } - template - struct hash > - { - size_t operator() (const db::edge_pair &o) const - { - return hfunc (o); - } - }; - /** * @brief Hash value for a text object */ @@ -220,15 +175,6 @@ namespace std return hfunc (o, size_t (0)); } - template - struct hash > - { - size_t operator() (const db::text &o) const - { - return hfunc (o); - } - }; - /** * @brief Hash value for a path */ @@ -259,15 +205,6 @@ namespace std return hfunc (o, size_t (0)); } - template - struct hash > - { - size_t operator() (const db::path &o) const - { - return hfunc (o); - } - }; - /** * @brief Hash value for a polygon contour */ @@ -294,15 +231,6 @@ namespace std return hfunc (o, size_t (0)); } - template - struct hash > - { - size_t operator() (const db::path &o) const - { - return hfunc (o); - } - }; - /** * @brief Hash value for a polygon */ @@ -330,15 +258,6 @@ namespace std return hfunc (o, size_t (0)); } - template - struct hash > - { - size_t operator() (const db::polygon &o) const - { - return hfunc (o); - } - }; - /** * @brief Hash value for a simple polygon */ @@ -355,15 +274,6 @@ namespace std return hfunc (o, size_t (0)); } - template - struct hash > - { - size_t operator() (const db::simple_polygon &o) const - { - return hfunc (o); - } - }; - /** * @brief Hash value for a simple transformation */ @@ -380,15 +290,6 @@ namespace std return hfunc (o, size_t (0)); } - template - struct hash > - { - size_t operator() (const db::simple_trans &o) const - { - return hfunc (o); - } - }; - /** * @brief A hash function for a displacement transformation */ @@ -405,15 +306,6 @@ namespace std return hfunc (o, size_t (0)); } - template - struct hash > - { - size_t operator() (const db::disp_trans &o) const - { - return hfunc (o); - } - }; - /** * @brief Hash value for a complex transformation */ @@ -434,15 +326,6 @@ namespace std return hfunc (o, size_t (0)); } - template - struct hash > - { - size_t operator() (const db::complex_trans &o) const - { - return hfunc (o); - } - }; - /** * @brief A hash value for a db::CellInstArray and db::DCellInstArray */ @@ -482,15 +365,6 @@ namespace std return hfunc (o, size_t (0)); } - template - struct hash > > - { - size_t operator() (const db::array > &o) const - { - return hfunc (o); - } - }; - /** * @brief Hash value for an object with properties */ @@ -507,15 +381,6 @@ namespace std return hfunc ((const O &) o, db::hash_for_properties_id (o.properties_id ())); } - template - struct hash > - { - size_t operator() (const db::object_with_properties &o) const - { - return hfunc (o); - } - }; - /** * @brief A hash function for a shape reference */ @@ -532,15 +397,6 @@ namespace std return hfunc (*o.ptr (), hfunc (o.trans ())); } - template - struct hash > - { - size_t operator() (const db::shape_ref &o) const - { - return hfunc (o); - } - }; - /** * @brief A hash function for a polygon reference */ @@ -557,15 +413,6 @@ namespace std return hfunc (*o.ptr (), hfunc (o.trans ())); } - template - struct hash > - { - size_t operator() (const db::polygon_ref &o) const - { - return hfunc (o); - } - }; - /** * @brief A hash function for a path reference */ @@ -582,15 +429,6 @@ namespace std return hfunc (*o.ptr (), hfunc (o.trans ())); } - template - struct hash > - { - size_t operator() (const db::path_ref &o) const - { - return hfunc (o); - } - }; - /** * @brief A hash function for a text reference */ @@ -607,15 +445,6 @@ namespace std return hfunc (*o.ptr (), hfunc (o.trans ())); } - template - struct hash > - { - size_t operator() (const db::text_ref &o) const - { - return hfunc (o); - } - }; - /** * @brief A hash value for a db::LayerProperties object */ @@ -637,14 +466,191 @@ namespace std return hfunc (o, size_t (0)); } +} + +namespace std +{ + + template + struct hash > + { + size_t operator() (const db::point &o) const + { + return tl::hfunc (o); + } + }; + + template + struct hash > + { + size_t operator() (const db::vector &o) const + { + return tl::hfunc (o); + } + }; + + template + struct hash > + { + size_t operator() (const db::box &o) const + { + return tl::hfunc (o); + } + }; + + template + struct hash > + { + size_t operator() (const db::edge &o) const + { + return tl::hfunc (o); + } + }; + + template + struct hash > + { + size_t operator() (const db::edge_pair &o) const + { + return tl::hfunc (o); + } + }; + + template + struct hash > + { + size_t operator() (const db::text &o) const + { + return tl::hfunc (o); + } + }; + + template + struct hash > + { + size_t operator() (const db::path &o) const + { + return tl::hfunc (o); + } + }; + + template + struct hash > + { + size_t operator() (const db::path &o) const + { + return tl::hfunc (o); + } + }; + + template + struct hash > + { + size_t operator() (const db::polygon &o) const + { + return tl::hfunc (o); + } + }; + + template + struct hash > + { + size_t operator() (const db::simple_polygon &o) const + { + return tl::hfunc (o); + } + }; + + template + struct hash > + { + size_t operator() (const db::simple_trans &o) const + { + return tl::hfunc (o); + } + }; + + template + struct hash > + { + size_t operator() (const db::disp_trans &o) const + { + return tl::hfunc (o); + } + }; + + template + struct hash > + { + size_t operator() (const db::complex_trans &o) const + { + return tl::hfunc (o); + } + }; + + template + struct hash > > + { + size_t operator() (const db::array > &o) const + { + return tl::hfunc (o); + } + }; + + template + struct hash > + { + size_t operator() (const db::object_with_properties &o) const + { + return tl::hfunc (o); + } + }; + + template + struct hash > + { + size_t operator() (const db::shape_ref &o) const + { + return tl::hfunc (o); + } + }; + + template + struct hash > + { + size_t operator() (const db::polygon_ref &o) const + { + return tl::hfunc (o); + } + }; + + template + struct hash > + { + size_t operator() (const db::path_ref &o) const + { + return tl::hfunc (o); + } + }; + + template + struct hash > + { + size_t operator() (const db::text_ref &o) const + { + return tl::hfunc (o); + } + }; + template <> struct hash { size_t operator() (const db::LayerProperties &o) const { - return hfunc (o); + return tl::hfunc (o); } }; + } #endif diff --git a/src/db/db/dbPropertiesRepository.cc b/src/db/db/dbPropertiesRepository.cc index b70850859..790b2a919 100644 --- a/src/db/db/dbPropertiesRepository.cc +++ b/src/db/db/dbPropertiesRepository.cc @@ -296,7 +296,7 @@ PropertiesSet::hash () const tl::MutexLocker locker (&lock); if (! m_hash) { - m_hash = std::hfunc (to_map ()); + m_hash = tl::hfunc (to_map ()); if (! m_hash) { // avoid 0 value as this is reserved for "not computed yet" m_hash = size_t (1); diff --git a/src/db/db/dbShape.cc b/src/db/db/dbShape.cc index 572c66139..75de096c5 100644 --- a/src/db/db/dbShape.cc +++ b/src/db/db/dbShape.cc @@ -867,15 +867,15 @@ size_t Shape::hash_value () const { size_t h = size_t (m_type); - h = std::hcombine (h, std::hfunc (m_trans)); + h = tl::hcombine (h, tl::hfunc (m_trans)); if (m_stable) { // Use the bytes of the iterator binary pattern (see operator<) for (unsigned int i = 0; i < sizeof (tl::reuse_vector::const_iterator); ++i) { - h = std::hcombine (h, size_t (m_generic.iter[i])); + h = tl::hcombine (h, size_t (m_generic.iter[i])); } } else { - h = std::hcombine (h, size_t (m_generic.any)); + h = tl::hcombine (h, size_t (m_generic.any)); } return h; diff --git a/src/db/db/gsiDeclDbBox.cc b/src/db/db/gsiDeclDbBox.cc index a1493570a..9b7d7177b 100644 --- a/src/db/db/gsiDeclDbBox.cc +++ b/src/db/db/gsiDeclDbBox.cc @@ -124,7 +124,7 @@ struct box_defs static size_t hash_value (const C *box) { - return std::hfunc (*box); + return tl::hfunc (*box); } static const C &bbox (const C *box) diff --git a/src/db/db/gsiDeclDbCell.cc b/src/db/db/gsiDeclDbCell.cc index 9dd9d1bc9..4b4bc70a5 100644 --- a/src/db/db/gsiDeclDbCell.cc +++ b/src/db/db/gsiDeclDbCell.cc @@ -448,7 +448,7 @@ struct cell_inst_array_defs static size_t hash_value (const C *i) { - return std::hfunc (*i); + return tl::hfunc (*i); } static bool less (const C *i, const C &other) diff --git a/src/db/db/gsiDeclDbEdge.cc b/src/db/db/gsiDeclDbEdge.cc index 6bef103c3..552365a38 100644 --- a/src/db/db/gsiDeclDbEdge.cc +++ b/src/db/db/gsiDeclDbEdge.cc @@ -170,7 +170,7 @@ struct edge_defs static size_t hash_value (const C *e) { - return std::hfunc (*e); + return tl::hfunc (*e); } static gsi::Methods methods () diff --git a/src/db/db/gsiDeclDbEdgePair.cc b/src/db/db/gsiDeclDbEdgePair.cc index 811c46dc5..8c34e5507 100644 --- a/src/db/db/gsiDeclDbEdgePair.cc +++ b/src/db/db/gsiDeclDbEdgePair.cc @@ -62,7 +62,7 @@ struct edge_pair_defs static size_t hash_value (const C *ep) { - return std::hfunc (*ep); + return tl::hfunc (*ep); } static gsi::Methods methods () diff --git a/src/db/db/gsiDeclDbLayout.cc b/src/db/db/gsiDeclDbLayout.cc index 2337f4712..19ab98411 100644 --- a/src/db/db/gsiDeclDbLayout.cc +++ b/src/db/db/gsiDeclDbLayout.cc @@ -126,7 +126,7 @@ db::LayerProperties li_from_string (const char *s, bool as_target) static size_t hash_value (const db::LayerProperties *l) { - return std::hfunc (*l); + return tl::hfunc (*l); } static bool log_equal_ext (const db::LayerProperties *lp1, const db::LayerProperties &lp2) diff --git a/src/db/db/gsiDeclDbPath.cc b/src/db/db/gsiDeclDbPath.cc index 2a1f84665..5fe72e8e9 100644 --- a/src/db/db/gsiDeclDbPath.cc +++ b/src/db/db/gsiDeclDbPath.cc @@ -111,7 +111,7 @@ struct path_defs static size_t hash_value (const C *e) { - return std::hfunc (*e); + return tl::hfunc (*e); } static gsi::Methods methods () diff --git a/src/db/db/gsiDeclDbPoint.cc b/src/db/db/gsiDeclDbPoint.cc index 9bf1ac090..e67501799 100644 --- a/src/db/db/gsiDeclDbPoint.cc +++ b/src/db/db/gsiDeclDbPoint.cc @@ -95,7 +95,7 @@ struct point_defs static size_t hash_value (const C *pt) { - return std::hfunc (*pt); + return tl::hfunc (*pt); } static C move_d (C *p, const vector_type &d) diff --git a/src/db/db/gsiDeclDbPolygon.cc b/src/db/db/gsiDeclDbPolygon.cc index 636d66119..4ebb782a0 100644 --- a/src/db/db/gsiDeclDbPolygon.cc +++ b/src/db/db/gsiDeclDbPolygon.cc @@ -275,7 +275,7 @@ struct simple_polygon_defs static size_t hash_value (const C *p) { - return std::hfunc (*p); + return tl::hfunc (*p); } static bool touches_box (const C *p, const db::box &box) @@ -1215,7 +1215,7 @@ struct polygon_defs static size_t hash_value (const C *p) { - return std::hfunc (*p); + return tl::hfunc (*p); } static bool touches_box (const C *p, const db::box &box) diff --git a/src/db/db/gsiDeclDbText.cc b/src/db/db/gsiDeclDbText.cc index ec665c9d5..54e3636f4 100644 --- a/src/db/db/gsiDeclDbText.cc +++ b/src/db/db/gsiDeclDbText.cc @@ -169,7 +169,7 @@ struct text_defs static size_t hash_value (const C *box) { - return std::hfunc (*box); + return tl::hfunc (*box); } static gsi::Methods methods () diff --git a/src/db/db/gsiDeclDbTrans.cc b/src/db/db/gsiDeclDbTrans.cc index dfa6b2df6..f9c579986 100644 --- a/src/db/db/gsiDeclDbTrans.cc +++ b/src/db/db/gsiDeclDbTrans.cc @@ -225,7 +225,7 @@ struct trans_defs static size_t hash_value (const C *t) { - return std::hfunc (*t); + return tl::hfunc (*t); } static gsi::Methods methods () @@ -853,7 +853,7 @@ struct cplx_trans_defs static size_t hash_value (const C *t) { - return std::hfunc (*t); + return tl::hfunc (*t); } static gsi::Methods methods () diff --git a/src/db/db/gsiDeclDbVector.cc b/src/db/db/gsiDeclDbVector.cc index 028ca9dca..19ce2b168 100644 --- a/src/db/db/gsiDeclDbVector.cc +++ b/src/db/db/gsiDeclDbVector.cc @@ -114,7 +114,7 @@ struct vector_defs static size_t hash_value (const C *v) { - return std::hfunc (*v); + return tl::hfunc (*v); } static db::point add_with_point (const C *v, const db::point &p) diff --git a/src/tl/tl/tlHash.h b/src/tl/tl/tlHash.h index 82b379a92..48ab308ae 100644 --- a/src/tl/tl/tlHash.h +++ b/src/tl/tl/tlHash.h @@ -47,7 +47,7 @@ * for use with std::unordered_map and std::unordered_set */ -namespace std +namespace tl { inline size_t hcombine (size_t h1, size_t h2) { @@ -57,14 +57,14 @@ namespace std template inline size_t hfunc (const T &t) { - hash hf; + std::hash hf; return hf (t); } template inline size_t hfunc (const T &t, size_t h) { - hash hf; + std::hash hf; return hcombine (h, hf (t)); } @@ -93,15 +93,6 @@ namespace std return hfunc (o.first, hfunc (o.second)); } - template - struct hash > - { - size_t operator() (const std::pair &o) const - { - return hfunc (o); - } - }; - /** * @brief Generic hash for an unordered set */ @@ -118,15 +109,6 @@ namespace std return hfunc (o, size_t (0)); } - template - struct hash > - { - size_t operator() (const std::unordered_set &o) const - { - return hfunc (o); - } - }; - /** * @brief Generic hash for a vector */ @@ -143,15 +125,6 @@ namespace std return hfunc (o, size_t (0)); } - template - struct hash > - { - size_t operator() (const std::vector &o) const - { - return hfunc (o); - } - }; - /** * @brief Generic hash for a list */ @@ -168,15 +141,6 @@ namespace std return hfunc (o, size_t (0)); } - template - struct hash > - { - size_t operator() (const std::list &o) const - { - return hfunc (o); - } - }; - /** * @brief Generic hash for a tl::slist */ @@ -193,15 +157,6 @@ namespace std return hfunc (o, size_t (0)); } - template - struct hash > - { - size_t operator() (const tl::slist &o) const - { - return hfunc (o); - } - }; - /** * @brief Generic hash for an ordered set */ @@ -218,15 +173,6 @@ namespace std return hfunc (o, size_t (0)); } - template - struct hash > - { - size_t operator() (const std::set &o) const - { - return hfunc (o); - } - }; - /** * @brief Generic hash for std::multiset */ @@ -243,15 +189,6 @@ namespace std return hfunc (o, size_t (0)); } - template - struct hash > - { - size_t operator() (const std::multiset &o) const - { - return hfunc (o); - } - }; - /** * @brief Generic hash for an unordered map */ @@ -271,15 +208,6 @@ namespace std return hfunc (o, size_t (0)); } - template - struct hash > - { - size_t operator() (const std::unordered_map &o) const - { - return hfunc (o); - } - }; - /** * @brief Generic hash for an ordered map */ @@ -299,15 +227,6 @@ namespace std return hfunc (o, size_t (0)); } - template - struct hash > - { - size_t operator() (const std::map &o) const - { - return hfunc (o); - } - }; - /** * @brief Generic hash for std::multimap */ @@ -327,15 +246,6 @@ namespace std return hfunc (o, size_t (0)); } - template - struct hash > - { - size_t operator() (const std::multimap &o) const - { - return hfunc (o); - } - }; - /** * @brief Create a pointer hash from the pointer's value */ @@ -344,7 +254,7 @@ namespace std { size_t operator() (const X *ptr) const { - return ptr ? hash () (*ptr) : 0; + return ptr ? std::hash () (*ptr) : 0; } }; @@ -400,6 +310,117 @@ namespace std #endif +#if defined(HAVE_64BIT_COORD) + + inline size_t hfunc (__int128 v) + { + return hcombine (hfunc (uint64_t (v)), hfunc (uint64_t (v >> 64))); + } + + inline size_t hfunc (__int128 v, size_t h) + { + return hcombine (hfunc (v), h); + } + +#endif + +} + +// provide some missing std::hash implementations based on our tl::hfunc + +namespace std +{ + + template + struct hash > + { + size_t operator() (const std::pair &o) const + { + return tl::hfunc (o); + } + }; + + template + struct hash > + { + size_t operator() (const std::unordered_set &o) const + { + return tl::hfunc (o); + } + }; + + template + struct hash > + { + size_t operator() (const std::vector &o) const + { + return tl::hfunc (o); + } + }; + + template + struct hash > + { + size_t operator() (const std::list &o) const + { + return tl::hfunc (o); + } + }; + + template + struct hash > + { + size_t operator() (const tl::slist &o) const + { + return tl::hfunc (o); + } + }; + + template + struct hash > + { + size_t operator() (const std::set &o) const + { + return tl::hfunc (o); + } + }; + + template + struct hash > + { + size_t operator() (const std::multiset &o) const + { + return tl::hfunc (o); + } + }; + + template + struct hash > + { + size_t operator() (const std::unordered_map &o) const + { + return tl::hfunc (o); + } + }; + + template + struct hash > + { + size_t operator() (const std::map &o) const + { + return tl::hfunc (o); + } + }; + + template + struct hash > + { + size_t operator() (const std::multimap &o) const + { + return tl::hfunc (o); + } + }; + } #endif diff --git a/src/tl/tl/tlVariant.cc b/src/tl/tl/tlVariant.cc index 38b5bf14b..c928ece63 100644 --- a/src/tl/tl/tlVariant.cc +++ b/src/tl/tl/tlVariant.cc @@ -992,63 +992,63 @@ Variant::hash () const size_t h = 0; if (m_type == t_double) { - h = std::hfunc (m_var.m_double); + h = tl::hfunc (m_var.m_double); } else if (m_type == t_float) { - h = std::hfunc (m_var.m_float); + h = tl::hfunc (m_var.m_float); } else if (m_type == t_bool) { - h = std::hfunc (m_var.m_bool); + h = tl::hfunc (m_var.m_bool); } else if (m_type == t_uchar) { - h = std::hfunc (m_var.m_uchar); + h = tl::hfunc (m_var.m_uchar); } else if (m_type == t_schar) { - h = std::hfunc (m_var.m_schar); + h = tl::hfunc (m_var.m_schar); } else if (m_type == t_char) { - h = std::hfunc (m_var.m_char); + h = tl::hfunc (m_var.m_char); } else if (m_type == t_ushort) { - h = std::hfunc (m_var.m_ushort); + h = tl::hfunc (m_var.m_ushort); } else if (m_type == t_short) { - h = std::hfunc (m_var.m_short); + h = tl::hfunc (m_var.m_short); } else if (m_type == t_uint) { - h = std::hfunc (m_var.m_uint); + h = tl::hfunc (m_var.m_uint); } else if (m_type == t_int) { - h = std::hfunc (m_var.m_int); + h = tl::hfunc (m_var.m_int); } else if (m_type == t_ulong) { - h = std::hfunc (m_var.m_ulong); + h = tl::hfunc (m_var.m_ulong); } else if (m_type == t_long) { - h = std::hfunc (m_var.m_long); + h = tl::hfunc (m_var.m_long); } else if (m_type == t_longlong) { - h = std::hfunc (m_var.m_longlong); + h = tl::hfunc (m_var.m_longlong); } else if (m_type == t_ulonglong) { - h = std::hfunc (m_var.m_ulonglong); + h = tl::hfunc (m_var.m_ulonglong); #if defined(HAVE_64BIT_COORD) } else if (m_type == t_int128) { - h = std::hfunc (m_var.m_int128); + h = tl::hfunc (m_var.m_int128); #endif } else if (m_type == t_id) { - h = std::hfunc (m_var.m_id); + h = tl::hfunc (m_var.m_id); } else if (m_type == t_bytearray) { - h = std::hfunc (*m_var.m_bytearray); + h = tl::hfunc (*m_var.m_bytearray); #if defined(HAVE_QT) } else if (m_type == t_qstring) { - h = std::hfunc (*m_var.m_qstring); + h = tl::hfunc (*m_var.m_qstring); } else if (m_type == t_qbytearray) { - h = std::hfunc (*m_var.m_qbytearray); + h = tl::hfunc (*m_var.m_qbytearray); #endif } else if (m_type == t_stdstring) { - h = std::hfunc (*m_var.m_stdstring); + h = tl::hfunc (*m_var.m_stdstring); } else if (m_type == t_string) { for (const char *cp = m_string; *cp; ++cp) { - h = std::hfunc (*cp, h); + h = tl::hfunc (*cp, h); } } else if (m_type == t_list) { - h = std::hfunc (*m_var.m_list); + h = tl::hfunc (*m_var.m_list); } else if (m_type == t_array) { - h = std::hfunc (*m_var.m_array); + h = tl::hfunc (*m_var.m_array); } else if (m_type == t_user) { // NOTE: this involves pointers ... - h = std::hfunc (m_var.mp_user.object, std::hfunc (m_var.mp_user.cls, 0)); + h = tl::hfunc (m_var.mp_user.object, tl::hfunc (m_var.mp_user.cls, 0)); } else if (m_type == t_user_ref) { const WeakOrSharedPtr *ptr = reinterpret_cast (m_var.mp_user_ref.ptr); - h = std::hfunc (ptr->get (), std::hfunc (m_var.mp_user_ref.cls, 0)); + h = tl::hfunc (ptr->get (), tl::hfunc (m_var.mp_user_ref.cls, 0)); } return h;