|
|
|
|
|
by terrymah
675 days ago
|
|
I think WG21 has been violently against adding additional UB to the language, because of some hacker news articles a decade ago about people being alarmed at null pointer checks being elided or things happening that didn’t match their expectation in signed int overflow or whatever. Generally it seems a view of spread that compiler implementers view undefined behavior as a license to party, that we’re generally having too much fun, and are not to be trusted. In reality undefined behavior is useful in the sense that (like this case) it allows us to not have to write code to consider and handle certain situations - code which may make all situations slower, or allows certain optimizations to exist which work 99% of the time. Regarding “not pan out”: I think the overhead of noexcept for the single function call case is fine, and inlining is and has always been the issue. |
|
Huh, didn't expect the no-UB sentiment to have extended that far back!
> Regarding “not pan out”: I think the overhead of noexcept for the single function call case is fine, and inlining is and has always been the issue.
Do you know if the other major compilers also face similar issues?