Re:Named Booleans prevent C++ bugs and save you time
by garaetjjte on Sunday February 19, 2023 @03:07PM
(#34861299)
>I was curious if the compiler will optimize in the short circuit even if you extract the eagerly
It will optimize, but not necessarily what you wanted... Because null dereference is UB (with default compiler flags), it's allowed to elide null check.
It will optimize, but not necessarily what you wanted... Because null dereference is UB (with default compiler flags), it's allowed to elide null check.