I have some C++ code that makes extensive use of !!. I'm kinda baffled because as far as I know !! is not a operator on it's own but two ! after each other. So that would mean that !!foo is the same as just foo.
Is there any place and or reason when !! actually makes sense? I was thinking about if it could perhaps have a bit wise meaning? So you first perform some bit wise operation on foo and then ! on the result? But I don't seem to remember ! being used as a bit wise operator and don't seem to find any reference telling me it is either. As far as I can tell ! in only used as a logical operator and in that case
!!foo == foo