Arguments for indexOf() and operator==()

Brad A Forrest <[email protected]>
Newsgroups gmane.comp.lib.icu.general
Message-ID <OF794F0246.18B3A182-ON85256DA9.004324D1-85256DA9.00432AE3@us.ibm.com>




Our testing shows that we can pass a char* to indexOf() and it works
correctly. But in the  ICU2.6 documentation I have found, I do not see a
indexOf() that takes a char*.  Can someone explain why indexOf(char*)
works, I would expect a compile error.  For example:
UnicodeString utext = "abcdefgh";
index = utext.indexOf("de");  //compiles and runs correctly, why?

We see similar behavior for operator==() although the only operator== I see
is:
UBool UnicodeString::operator==( const UnicodeString & text) const [inline]

Thanks,
Brad A. Forrest
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.