Extends.
I thought I was being cool when I did something like:
bool hasParent()
{
return this->parentNode ;
}
Even with a (bool) cast, the
The fact that casting to bool does not make the warning go away is by design:
Casting the expression to type bool will not disable the warning, which is by design.
I would recommend the approach that the MSDN description of warning C4800 recommends:
return this->parentNode != NULL;
this makes it clear that you are returning true if parentNode is not a null pointer and false if parentNode is a null pointer.