logoalt Hacker News

aw1621107today at 5:22 PM0 repliesview on HN

To add on to this, the C++ proposal for [[assume]] [0] came to a similar conclusion and cites MSVC's experience with an assert-in-debug-assume-in-release construction (i.e., removing the assumptions resulted in a 1-2% speedup and increased reliability) as a reason to not tie assertions to assumptions.

[0]: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p17...

[1]: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p20...