Built-in shift operators are only applicable to values of integral or unscoped enum types. Built-in comparison to your null
is only legal for values of pointer types. This means that results of built-in shift can never be compared to your null
. (The only potential loophole here is the possibility to use shifts to form a null-pointer constant - an integral zero. But this is only possible in pre-C++11 version of the language. Not anymore.) The comparison is invalid.
In other words, there's no valid context in which this question can even arise. Your if
will not produce "dead code" or "alive code". It simply won't compile at all.
But if you are talking about overloaded operators, then everything is possible. However, in that case your question is too broad to make sense.