In C++ there is a construction !! applicable to non bool values to convert it to bool. For instance:
int n = 12;
if ( !!n )
std::<<cout << "n is true";
else
std::<<cout << "n is false";
Is there any restrictions where it can be applied, or which types is applicable: POD, pointers, etc.?
The restriction is that
operator!must be defined for the type (and it must yield a type for whichoperator!is also defined)