Quote Originally Posted by nuzzle View Post
I've never found a reason to use the conversion operator so I may be wrong here but if you define a conversion operator why do you need to cast at all? Why don't you simply do,

B* pB = a; // #3

All of #1, #2 and #3 work but if you remove the conversion operator from A none of them will. That means they're all functionally equivalent in this case. They all simply invoke the conversion operator.

Generally they're not equivalent though. When you cast explicitly you're recommended to use one of the "new" more targeted casts. In this case it would be static_cast.
I agree with you. If someone uses B* pB = (B*)a, then it is not good to use C style casting in C++. If someone uses B* pB = static_cast<B*>(a), then there is a dilemma that why would cast operator is equivalent to static_cast instead of dynamic_cast or reinterpret_cast?