Daily bit(e) of C++ | [[assume(expr)]];
Daily bit(e) of C++ #326, The C++23 attribute for introducing UB into a program: [[assume(expr)]];
The C++23 introduced the [[assume(expr)]]; attribute that can be used to introduce undefined behaviour into a program.
Instead of relying on other language-level UB, the attribute can be specified with an expression the compiler can assume is true, allowing the compiler to optimize the code aggressively.
If any assumption is violated, the program is in an invalid state.