This is a type conversion operator. It allows you to implicitly convert a type object MyClass
to a pointer, without requiring the use of an address operator.
Here is a small example to illustrate:
void foo(MyClass *pm) {
}
int main() {
MyClass m;
foo(m);
foo(&m);
}
And why the transformation is determined, which is debatable. Honestly, I have never seen this in the wild, and I cannot guess why it was identified.
source
share