File tree Expand file tree Collapse file tree 2 files changed +67
-0
lines changed
Expand file tree Collapse file tree 2 files changed +67
-0
lines changed Original file line number Diff line number Diff line change 1+ klayout (0.30.0-1) unstable; urgency=low
2+
3+ * New features and bugfixes
4+ - See changelog
5+
6+ -- Matthias Köfferlein <matthias@koefferlein.de> Tue, 25 Mar 2025 00:00:00 +0100
7+
18klayout (0.29.12-1) unstable; urgency=low
29
310 * New features and bugfixes
Original file line number Diff line number Diff line change 3434#include < functional>
3535#include < stdint.h>
3636
37+ // for std::hash of QString and QByteArray
38+ #if defined(HAVE_QT)
39+ # include < QString>
40+ # include < QByteArray>
41+ #endif
42+
3743#include " tlSList.h"
3844
3945/* *
@@ -342,6 +348,60 @@ namespace std
342348 }
343349 };
344350
351+ #if defined(HAVE_QT) && QT_VERSION < 0x050000
352+
353+ /* *
354+ * @brief Generic hash for QString
355+ */
356+
357+ template <>
358+ size_t hfunc (const QString &o, size_t h)
359+ {
360+ return hfunc_iterable (o, h);
361+ }
362+
363+ template <>
364+ size_t hfunc (const QString &o)
365+ {
366+ return hfunc (o, size_t (0 ));
367+ }
368+
369+ template <>
370+ struct hash <QString>
371+ {
372+ size_t operator () (const QString &o) const
373+ {
374+ return hfunc (o);
375+ }
376+ };
377+
378+ /* *
379+ * @brief Generic hash for QByteArray
380+ */
381+
382+ template <>
383+ size_t hfunc (const QByteArray &o, size_t h)
384+ {
385+ return hfunc_iterable (o, h);
386+ }
387+
388+ template <>
389+ size_t hfunc (const QByteArray &o)
390+ {
391+ return hfunc (o, size_t (0 ));
392+ }
393+
394+ template <>
395+ struct hash <QByteArray>
396+ {
397+ size_t operator () (const QString &o) const
398+ {
399+ return hfunc (o);
400+ }
401+ };
402+
403+ #endif
404+
345405}
346406
347407#endif
You can’t perform that action at this time.
0 commit comments