[Patch] fix compile kdecore with msvc

Thiago Macieira thiago at kde.org
Sun Oct 30 14:57:13 GMT 2005


Christian Ehrlicher wrote:
>> Your argument doesn't make sense. Functions that were not overridden
>> will be inherited from QList<T>.
>
>You're wrong. It's true for simple types but not for classes. Try to
>compile this piece of code:
>
>--------------------8<------------------
>#include <QList>
>
>struct testStruct {
>	int iFirst;
>	int iSecond;

bool operator==(const testStruct&) const;

>};
>
>int main(int argc, char *argv[])
>{
>    QList<int> t1, t2;
>    QList<testStruct> s1, s2;
>
>    if ( t1 == t2 )
>        qDebug("t1 == t2");
>    if ( s1 == s2 )
>        qDebug("s1 == s2");
>	return 1;
>}
>--------------------8<------------------
>gcc will fail here (so it's  not only the stupid msvc-compiler).

By adding the line I showed above, it compiles.

You cannot compare two structs unless they provide operator==.

Since KResolverEntry doesn't, you cannot compare two KResolverResults. 
You're not supposed to, either, nor transform it into a set or vector.

As for your toSet() test, did you include <QSet>? Because that's where 
QList<T>::toSet() is defined.

Anyways, removing the export macro from KResolverResults is out of the 
question. If you have a problem compiling, let's work out another 
solution.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

5. Swa he géanhwearf tó timbran, and hwonne he cóm, lá! Unix cwæð "Hello, 
World". Ǽfre ǽghwilc wæs glæd and seo woruld wæs fréo.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20051030/6c4fc472/attachment.sig>


More information about the kde-core-devel mailing list