我有以下類:插入元素爲展示Qset類
class UnionFuzzySet : public FuzzySet
{
public:
UnionFuzzySet();
void addActivatedFuzzySet(const ActivatedFuzzySet &set);
double getValue(double value);
private:
QSet<ActivatedFuzzySet> subConclusions;
};
和方法addActivatedFuzzySet(...):
C:
3210它不編譯錯誤工作:\ QtSDK \ Desktop \ Qt \ 4.8.0 \ msvc2010 \ include \ QtCore \ qhash.h:882:ошибка:C2665:'qHash':16個重載中沒有一個可以轉換所有參數類型 c:\ QtSDK \ Desktop \的Qt \ 4.8.0 \ msvc2010 \ INC lude \ QtCore/qhash.h(62):可能是'uint qHash(char)' c:\ QtSDK \ Desktop \ Qt \ 4.8.0 \ msvc2010 \ include \ QtCore/qhash.h(63):or'uint qHash(uchar)' c:\ QtSDK \ Desktop \ Qt \ 4.8.0 \ msvc2010 \ include \ QtCore/qhash.h(64):或'uint qHash(signed char)' c:\ QtSDK \ Desktop \ Qt \ 4.8.0 \ msvc2010 \ include \ QtCore/qhash.h(65):或'uint qHash(ushort)' c:\ QtSDK \ Desktop \ Qt \ 4.8.0 \ msvc2010 \ include \ QtCore/qhash.h 66):或'uint qHash(short)' c:\ QtSDK \ Desktop \ Qt \ 4.8.0 \ msvc2010 \ include \ QtCore/qhash.h(67):或'uint qHash(uint)' c:\ QtSDK \ Desktop \ Qt \ 4.8.0 \ msvc2010 \ include \ QtCore/qhash.h(68):或'uint qHash(int)' c:\ QtSDK \ Desktop \ Qt \ 4.8.0 \ msvc2010 \ include \ QtCore /qhash.h(69)或'uint qHash(ulong)' c:\ QtSDK \ Desktop \ Qt \ 4.8.0 \ msvc2010 \ include \ QtCore/qhash.h(77):or'uint qHash (long)' c:\ QtSDK \ Desktop \ Qt \ 4.8.0 \ msvc2010 \ include \ QtCore/qhash.h(78):或'uint qHash(quint64)' c:\ QtSDK \ Desktop \ Qt \ 4.8 (86):或'uint qHash(qint64)' c:\ QtSDK \ Desktop \ Qt \ 4.8.0 \ msvc2010 \ include \ QtCore/qhash.h(87) :或'uint qHash(QChar)' c:\ QtSDK \ Desktop \ Qt \ 4.8.0 \ msvc2010 \ include \ QtCore/qhash.h(88):或'uint qHash(const QByteArray &)' c:\ QtSDK \ Desktop \ Qt \ 4.8.0 \ msvc2010 \ include \ QtCore/qhash.h(89):或'uint qHash(const QString &)' c:\ QtSDK \ Desktop \ Qt \ 4.8.0 \ msvc2010 \ include \ QtCore/qhash.h(90)或'uint qHash(const QStringRef &)' c:\ QtSDK \ Desktop \ Qt \ 4.8.0 \ msvc2010 \ include \ QtCore/qhash.h(91):or'uint qHash(常量QBitArray &)' while試圖匹配參數列表'(const ActivatedFuzzySet)'
請告訴我,我在哪裏犯了一個錯誤?
謝謝你的回覆。我應該如何更改我的代碼? – user1166635 2012-02-18 17:19:53
指針集有什麼用處? – Lol4t0 2012-02-18 17:20:54
但他想要一個基於項目等價的集合,而不是指針等價。 – pmr 2012-02-18 17:28:17