G
Guest
WriteLine has default handlers for basic types and object. The object
versions call ToString(), so overloading ToString() would normally do the job.
However, I have an implicit operator bool() in the object, so the compiler
converts my object to bool and calls the bool version of WriteLine instead of
the object version.
Is there any way around this, other than typecasting my object when calling
WriteLine()?
versions call ToString(), so overloading ToString() would normally do the job.
However, I have an implicit operator bool() in the object, so the compiler
converts my object to bool and calls the bool version of WriteLine instead of
the object version.
Is there any way around this, other than typecasting my object when calling
WriteLine()?