X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Ftypes.h;h=e2a9aab5e359f7242d637a8aaee73c6d97fe15cd;hp=a806c58f378330c736bce3a178ac6f8002ca5755;hb=579e559a6322209df7cd51c34801fecff5fe734b;hpb=c1cf157116de7fc3da96203aa6f03c38c7ebb650 diff --git a/src/common/types.h b/src/common/types.h index a806c58f..e2a9aab5 100644 --- a/src/common/types.h +++ b/src/common/types.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2018 by the Quassel Project * + * Copyright (C) 2005-2019 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -195,6 +195,7 @@ Q_DECLARE_METATYPE(QHostAddress) using MsgIdList = QList; using BufferIdList = QList; +#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) /** * Catch-all stream serialization operator for enum types. * @@ -224,6 +225,17 @@ QDataStream& operator>>(QDataStream& in, T& value) value = static_cast(v); return in; } +#endif + +// STL-compliant hash functor for Qt types +template +struct Hash +{ + uint operator()(const T& t) const + { + return qHash(t); + } +}; // Exceptions