SafeInt
SafeInt copied to clipboard
SafeInt is a class library for C++ that manages integer overflows.
Would it be possible to make `SafeIntExceptionAssert` simply `inline` once again? Here's the error as seen in msvc > safeint3.hpp(430,20): error C2129: static function 'void SafeIntExceptionAssert(void) noexcept' declared but not...
It seems to me that several class templates and enums from the SafeInt.hpp header pollute the global namespace. There should be a `safeint` namespace enclosing those, including the `SafeInt` class...
Fix issues #51 #56 #57 #58 Fix compatibility with Windows Platform SDK headers with proper parentheses around `(std::numeric_limits::min)()` and `(std::numeric_limits::max)()`. Moreover, encloses the header code in a namespace (`safeint`) to...
The SafeInt.hpp header defines some preprocessor macros that could cause naming collisions, e.g.: `CPLUSPLUS_98`, `CPLUSPLUS_11`, and many others. Those preprocessor macros should have proper prefixes to avoid naming conflicts, e.g....
Hi, I maintain the debian package of [safeint](https://tracker.debian.org/pkg/safeint), but since Debian/unstable switched its default compiler to gcc-13, safeint fails to build (at least CompileTest) as reported in [#1042152](https://bugs.debian.org/1042152). I thought...
This discussion goes over the issue: https://stackoverflow.com/questions/27442885/syntax-error-with-stdnumeric-limitsmax I have tested locally and simply enclosing the calls to std::numeric_limits::min/max in parenthesis completely fixes the issues, while changing no functionality on the...
Up front, Trying to use SafeInt to cast to an enum seems like something that should be rejected at compile time to me (possibly through the use of `static_assert` but...
This should be what's needed to prevent a SafeInt from being constructed from an enum, though a SafeInt of some defined type could be initialized from an enum. It still...
The class had assertions for UB on shift, turn the asserts into exceptions.
When shifting a safe integer beyond its width I would expect this library to raise an exception; instead I run into an assertion failure. ```cpp #include "SafeInt/SafeInt.hpp" // Shift an...