I had a roommate in college who would write code like this. I (and several other people) tried to explain to him that he couldn't necessarily count on the pattern working all the time. His response was to say, "But it works here!" and continue abusing C++'s undefined behavior.
I stopped giving him help with his CS coursework in fairly short order.
I stopped giving him help with his CS coursework in fairly short order.