forked from qt-creator/qt-creator
LSP: Make hash and debug operator hidden friends
Change-Id: I91e7f8d7e9d21faa5d9bcd3f2d43fa61d22ab44c Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -65,18 +65,17 @@ public:
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
friend auto qHash(const MessageId &id)
|
private:
|
||||||
|
friend size_t qHash(const MessageId &id)
|
||||||
{
|
{
|
||||||
if (std::holds_alternative<int>(id))
|
if (std::holds_alternative<int>(id))
|
||||||
return QT_PREPEND_NAMESPACE(qHash(std::get<int>(id)));
|
return qHash(std::get<int>(id));
|
||||||
if (std::holds_alternative<QString>(id))
|
if (std::holds_alternative<QString>(id))
|
||||||
return QT_PREPEND_NAMESPACE(qHash(std::get<QString>(id)));
|
return qHash(std::get<QString>(id));
|
||||||
return QT_PREPEND_NAMESPACE(qHash(0));
|
return qHash(0);
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
template <typename Error>
|
friend QDebug operator<<(QDebug stream, const MessageId &id)
|
||||||
inline QDebug operator<<(QDebug stream, const LanguageServerProtocol::MessageId &id)
|
|
||||||
{
|
{
|
||||||
if (std::holds_alternative<int>(id))
|
if (std::holds_alternative<int>(id))
|
||||||
stream << std::get<int>(id);
|
stream << std::get<int>(id);
|
||||||
@@ -84,6 +83,7 @@ inline QDebug operator<<(QDebug stream, const LanguageServerProtocol::MessageId
|
|||||||
stream << std::get<QString>(id);
|
stream << std::get<QString>(id);
|
||||||
return stream;
|
return stream;
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
struct ResponseHandler
|
struct ResponseHandler
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user