I have the following class:
class MyClass { public: MyClass( char* what ) : controlled( what ) {} ~MyClass() { delete[] controlled; } operator char*() c
operator bool is the best match, because char* and void* can't be converted to long without an explicit cast, unlike bool:
operator bool
char*
void*
long
bool
long L1 = (void*)instance; // error long L2 = (char*)instance; // error long L3 = (bool)instance; // ok