PDA

View Full Version : QPair<T1, T2> == operator is not working as expected?



70thCommander
22nd December 2010, 10:28
Hello Community,

i have the following codelines which gives a result of "true" out of the console.


QPair<QString, QString> blub, bla;

blub.first=="a";
blub.second=="b";
bla.first=="a";
bla.second=="z";

qDebug() << (blub == bla);
Why is this equal?

Lykurg
22nd December 2010, 10:33
Ehm, notice the difference between = and ==

Line 3 to 6 are wrong. And the result is quite fine since both pairs are empty...

70thCommander
22nd December 2010, 10:37
Ehm, notice the difference between = and ==

Line 3 to 6 are wrong. And the result is quite fine since both pairs are empty...

Right, I see ....
this is just a test of the forum user skillz ... ;)

Oh my god it was late yesterday!