Urgent ::I can't define a function to accept "" or NULL

I have

myclass::operator << (std::string data) {}

myclass::operator << (const char * data) {}

myclass::operator << (bool data) {}

Ok , if I call class<<""; I see that function used is the bool ???????

And If I call class<<NULL; I have a runtime error.

Any idea? Thanks
Last edited on
Why do you keep creating new threads on the same topic? you can keep it in one place.
class << "" should call the const char* overload.
NULL is an integer constant so it will be ambiguous. How should your << act on NULL?
Please , delete this post
Last edited on
Why do you call class<<NULL ?
If you have a char pointer you can check if it's NULL before calling <<
Topic archived. No new replies allowed.