Fix namespace issues std:: template specialization

This commit is contained in:
Ryan Huffman 2015-09-14 12:17:36 -07:00
parent 42d21e4dc1
commit 29d26a1f9a
2 changed files with 11 additions and 7 deletions

View file

@ -34,6 +34,8 @@ using ReceivedAssetCallback = std::function<void(bool responseReceived, AssetSer
using GetInfoCallback = std::function<void(bool responseReceived, AssetServerError serverError, AssetInfo info)>;
using UploadResultCallback = std::function<void(bool responseReceived, AssetServerError serverError, const QString& hash)>;
class AssetClient : public QObject, public Dependency {
Q_OBJECT
public:

View file

@ -88,13 +88,15 @@ private:
typedef QSharedPointer<Node> SharedNodePointer;
Q_DECLARE_METATYPE(SharedNodePointer)
template<>
struct std::hash<SharedNodePointer> {
std::size_t operator()(const SharedNodePointer& p) const {
// Return the hash of the pointer
return std::hash<Node*>()(p.data());
}
};
namespace std {
template<>
struct hash<SharedNodePointer> {
size_t operator()(const SharedNodePointer& p) const {
// Return the hash of the pointer
return hash<Node*>()(p.data());
}
};
}
QDebug operator<<(QDebug debug, const Node& node);