[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: [Patch] fix compile kdecore with msvc
From:       Thiago Macieira <thiago () kde ! org>
Date:       2005-10-30 14:57:13
Message-ID: 200510301257.14568.thiago () kde ! org
[Download RAW message or body]


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.

[Attachment #3 (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic