String comparison

I was wondering... Does anyone know the difference between these 2 codes ?

String A,B;
if (A == B) ...


String A,B;
if ( == 0) ...

Both seem to work.

The equality operator calls the compare function.

you could read the source code in juce_String.cpp at line 574.

the == operator actually calls == 0

You're right. I (wrongly) keep thinking that the API lists functions which are useful for the final developer...

So selfish !


Both functions are useful for the final developer ; it depends of situations and taste ;-)

If you care about under the hood machinery (for optimization for instance) the JUCE sources are (IMHO) easily browsable. Personnaly i go through them more often than i open the html documentation.