Original Post
I remember seeing in a thread a while back about a class that overloaded something I'd never seen before: operator bool. From what I gathered, it looked like it allowed you to provide a method to cast the object into a primitive type. Is that how it works? Can you also create similar overloads for user-defined types? Is there anything wrong with doing this? And is there a reason why std::string uses c_str() instead of casting into a char*? Or does this type of overloading not work for pointers?