[Interest] QString operator==

André Somers andre at familiesomers.nl
Wed Aug 22 13:35:19 CEST 2012


Op 21-8-2012 13:14, Bo Thorsen schreef:
> Den 21-08-2012 13:09, Thomas Meyer skrev:
>> Hi,
>> I can't find the definition for
>> ...
>> booloperator==(constQString&s)const;
>> ...
>> in QString (.h, line 403, Qt v4.8.2 (MS Windows 7)).
>>
>> I only found it for QLatinString and QByteArray:
>> (Where is the declaration for QByteArray?)
>> ...
>> inlineboolQByteArray::operator==(constQString&s)const
>> {returnqStringComparisonHelper(s,constData());}
>> ...
>>
>> Please can somebody help me?
> It's in qstring.cpp:
>
> bool QString::operator==(const QString &other) const
> {
>       if (d->size != other.d->size)
>           return false;
>
>       return qMemEquals(d->data, other.d->data, d->size);
> }
>
> Bo Thorsen,
> Fionia Software.
>
Hmmm... Wouldn't it make sense to also check on the the d pointers 
actually being the same? Or is that in qMemEquals?

André




More information about the Interest mailing list