intel / safe-arithmetic

Safe arithmetic library for C++20 and above. Safe arithmetic ensures correctness of arithmetic operations at compile-time. It protects against overflow, underflow, divide by zero, and out-of-bounds index access. This provides both functional correctness as well as greater protection against related security threats.
https://intel.github.io/safe-arithmetic/
Boost Software License 1.0
83 stars 10 forks source link

✨ add accumulate, enhance invoke and rename it to function #10

Closed lukevalenty closed 1 year ago

lukevalenty commented 1 year ago

Some enhancements inspired by solving the 2022 advent of code problems with safe arithmetic.

lukevalenty commented 1 year ago

wip

lukevalenty commented 1 year ago

The last commit adds some pretty loose concepts for ranges and iterators to help the compiler pick the correct safe::accumulate overload. these were added because the range-v3 library iterators are not compatible with the std iterator concepts. 😳