Hacker News new | ask | show | jobs
by RcouF1uZ4gsC 1466 days ago
This is undefined behavior. According to the C++ standard, there is no way to reason about what this does. Anything can happen with this code.

Once you have undefined behavior, you lose the ability to reason about your entire program.

Thus, this program does not solve the problem.

It demonstrates a lack of knowledge about undefined behavior in C++.

Rating: Absolutely would never hire this candidate.

1 comments

Undefined behavior doesn't mean there is no way to reason about what the program does according to ISO C++. It means that the way to reason about it is outside of ISO C++, in specific ways, like that it may be a documented extension in the implementation or numerous other possibilities; you have to research those possibilities before concluding that there remains no way to reason about it.