Use the safe bool idiom to avoid unwanted implicit conversions.