The class with this code is a reference class for a pointer of ClassName, i.e.:
class ClassName;
class ClassRef
{
ClassName* m_class;
...
operator ClassName *() const { return m_class; }
...
I am assuming this is used for pointer validity checks, such as:
ClassRef ref(new ClassName())
if (ref) { bla bla bla }
Am I correct in my thinking?
This is an overload of the conversion operator. Whenever a
ClassRefobject needs to be converted to aClassNamepointer type, this operator is called.So;
will make use of this overload.