I understand what a double exclamation mark does (or I think I understand) but I am not sure how it is defined on a random object. For example in the code snippet below:
The easiest way to remember double-negation !!a is to narrow a!=0 to 1 and a==0 to 0. Which is in boolean context (i.e. C++) true or false.