I'm using Qt and I want to declare following container:
QMap<QUrl , QSet<ClassSharedPtr> > map;
Here ClassSharedPtr is the boost shared ptr of class "Class".
typedef boost::shared_ptr<const Class> ClassPtr;
I'm getting following errors after adding header file #include :
error: no matching function for call to ‘qHash(const boost::shared_ptr<const Class>&)’
QSet's value data type must be an assignable data type. In addition, the type must provideoperator==(), and there must also be aqHash()function in the type's namespace that returns a hash value for an argument of the values's type.So, you should implement
qHash()function forboost::shared_ptr<const Class>.