int != safe && int != ℤ
summary
C++ integer operations silently change type, promote signedness and cause UB; examples include the 50,000×50,000 example that triggers signed overflow via integral promotion, and the int min / -1 division case. The talk shows a single-header library implementing overflow-detection enums and saturation (sat) intrinsics, compares assembly to plain int (nearly identical for enums), and reports extensive compile-time and SFINAE tests proving the replacements catch or clamp errors while remaining efficient.
AI-written summary · about
chapters (16)
- 0:00Introduction
- 1:11Integers in theory
- 4:00Int in practice
- 10:01Integer overflow risks
- 15:24Undefined behavior probability
- 21:12Problems with int type
- 27:55Better int alternatives
- 31:11Handling overflow
- 35:07Library implementation
- 42:30Type safety design
- 47:30Compile-time checks
- 54:10SFINAE testing
- 58:06Saturation arithmetic
- 1:00:38C++20 saturation features
- 1:02:25Testing and debugging
- 1:05:44Resources and Q&A
