X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Ftypes.h;h=eb0c0ca20b116c2d8b70e9fec1aed3875fe28be9;hp=5c800952987a1243dec92408e31b56d82097f904;hb=61aac1868f15babb7086d8bc6bbcff530346f438;hpb=933e1bf5264b6bbd91941f1f06e6e9675e24221a diff --git a/src/common/types.h b/src/common/types.h index 5c800952..eb0c0ca2 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; -};