A strange behavior of overloaded operator '<<'

if have :
myclass& operator << (std::string data);
myclass& operator << (bool data);

Ok I dont know what can be happen, but
myclass<<"hello"; is processed like a bool ????
Any idea? Thanks

And... Thank you very much to everybody that are helping me !
That doesn't make sense.

Can you reproduce the problem in a minimal example and post the code for it?
Solved, with :

myclass& operator << (char * data);

myclass<<"hello"; is processed as char *
.....
Likewise, you need to qualify all your argument types with const.

myclass& operator << (const std::string& s);
myclass& operator << (const int& n);
myclass& operator << (const point& pt);

etc
Topic archived. No new replies allowed.