X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcommon%2Ftypes.h;h=a801de7cdf7d139d111eee991d25a710877eddd5;hb=28107860d0c324fa015477299853c4060bb5403e;hp=8782d74496059f6288f10d9b65979540d7401334;hpb=2c438150c5f66140ab087e559b9d390053963ad7;p=quassel.git diff --git a/src/common/types.h b/src/common/types.h index 8782d744..a801de7c 100644 --- a/src/common/types.h +++ b/src/common/types.h @@ -115,7 +115,7 @@ typedef QList BufferIdList; * @returns A reference to the stream */ template{}, int>::type = 0> + typename = typename std::enable_if::value>::type> QDataStream &operator<<(QDataStream &out, T value) { out << static_cast::type>(value); return out; @@ -125,24 +125,14 @@ QDataStream &operator<<(QDataStream &out, T value) { * Catch-all stream serialization operator for enum types. * * @param[in,out] in Stream to deserialize from - * @param[in] value Value to deserialize into + * @param[out] value Value to deserialize into * @returns A reference to the stream */ template{}, int>::type = 0> + typename = typename std::enable_if::value>::type> QDataStream &operator>>(QDataStream &in, T &value) { typename std::underlying_type::type v; in >> v; value = static_cast(v); return in; } - -//! Base class for exceptions. -struct Exception { - Exception(QString msg = "Unknown Exception") : _msg(msg) {} - virtual ~Exception() {} // make gcc happy - virtual inline QString msg() { return _msg; } - -protected: - QString _msg; -};