c++ - Why doesn't Qt's qHash() have an overload for std::shared_ptr? -
i found out, surprise, following code not compile out of box in c++14 using qt 5.4:
qset<std::shared_ptr<sometype>> var;
the problem there no overload of qhash()
method std::shared_ptr
, or other smart pointer far can see: http://doc.qt.io/qt-5/qhash.html#related-non-members
it seems natural me have following overload (or similar):
template <typename t> uint qhash(const std::shared_ptr<t>& ptr, uint seed = 0) { return qhash(ptr.get(), seed); }
but not exist. cannot qt developers overlooked. need include special header? reason why not exist?
speak of devil, , doth appear: https://codereview.qt-project.org/113340
this cannot qt developers overlooked.
it's not overlook, it's qt doesn't have endless resources add qhash
overloads stl type has operator==
.
Comments
Post a Comment