safe_numerics
safe_numerics copied to clipboard
Replacements to standard numeric types which throw exceptions on errors
Working on clang modules, as a proxy for C++20 header units, I see boost/safe_numerics/concept/safe_numeric.hpp # includes itself. That seems unnatural. [Uploading boost-includes.txt…]()
The comment of "constexpr tribool excludes(const R & t) const" function is wrong. Maybe the original comment is just copied from the "includes" function and forgot to make a correction....
To my understanding `safe` should work in any template as integer safety is orthogonal. I am unable to use `safe` in `std::span` in MSVC: ```c++ #include #include #include using Int...
I am not sure if technically a bug, but from the documentation and talks what I understood was that in my code I can basically replace `int` with `safe` and...
The modulo interval arithmetic produces incorrect results. The resulting interval can be _smaller_ than the possible values that could arise at runtime. I have an example on GitHub that produces...
Since https://github.com/boostorg/safe_numerics/commit/937928693d40564a72fd48f63039040908098132, building ``` #include #include #include template struct fmt::formatter< boost::safe_numerics::safe_base< Stored, Min, Max, P, E > > : fmt::ostream_formatter { }; void la() { fmt::print("{}", boost::safe_numerics::safe{ 4 }); }...
While working on a sample for #129 I tried the following code ([godbolt.org](https://godbolt.org/z/qaW55EKj1)): ```c++ using delta_safe_t = boost::safe_numerics::safe_signed_range< -1, 1, boost::safe_numerics::native, boost::safe_numerics::loose_trap_policy >; template using const_safe_t = boost::safe_numerics::safe_signed_literal< I, boost::safe_numerics::native,...
Is it possible to somehow include non-continuous ranges? For example. in computation, I'm using an `enum` (converted to its underlying type). The `enum` has a few possible values but the...
We are in the process of making B2 build changes to all of the B2 build files to support "modular" consumption of the Boost Libraries by users. See this list...
The header `checked_result_operations.hpp` calls `std::terminate` which is in `` but the latter is not included, causing compilation failures with clang 18 and libc++: ``` include/boost/safe_numerics/checked_result_operations.hpp:40:14: error: no member named 'terminate'...