160 Commits

Author SHA1 Message Date
Robert Ramey
0eaf4c8149 fix issues and PRs 2021-05-23 15:56:56 -07:00
Robert Ramey
42a6cdd82b Regenerated Documentation.
Still pending - remove/remake concept SafeNumeric.
2021-05-16 18:49:31 -07:00
Robert Ramey
36dca408ce Rationalized concepts for Numeric and Integer. The concept integer not currently used. 2021-05-16 17:52:47 -07:00
Robert Ramey
6629424a7f Major implementation change: Only Numeric concept still exists. And that is almost all “optional” members. User interface is the same. 2021-05-08 15:05:50 -07:00
Robert Ramey
a742337b94 adjusted Jam and CMake files to eliminate bogus tests failures in boost test matrix. 2020-11-10 10:59:12 -08:00
Robert Ramey
ab13c7bed4 update documentation 2020-11-07 09:19:36 -08:00
Robert Ramey
cbb4197a17 cleaned up definitions for constructors and casting operators
passes all tests and examples.
minor documentation fixes
2020-11-07 07:09:37 -08:00
Robert Ramey
75df037bc8 fixed various issues raised in mini-review.
a) streaming negative numbers into unsigned integers is now handled properly.
b) documentation improved/corrected to better show the relationship between policies and safe integer types
2020-10-16 21:16:26 -07:00
Robert Ramey
82d3be1cf4 documentation updates and corrections
due mostly to Andrzej Krzemieński
2020-10-14 06:11:35 -07:00
Andrzej Krzemieński
96a38192dc docs: fix namespace in introduction (#86)
* docs: fix namespace in introduction

* Docs: use naespace safe_numerics also in prose
2020-10-14 05:11:03 -07:00
Robert Ramey
34d0a2196d corrected error in safe_range where by minimum was fixed a zero
Improved implementation/definition of error_policies
added test for custom error policy
changed documentation in accordance with the above.
2020-06-23 14:00:31 -07:00
Robert Ramey
f4f0352b60 fix links to *.hpp files in documentation 2019-05-10 04:31:00 -07:00
Robert Ramey
accdb4062b build documentation from latest boost book in preparation for checkin 2019-05-09 11:13:32 -07:00
Robert Ramey
58db776217 ixed issue related to lack of constexpr in exception with an “inline”
miscellaneous improvements in documentation
improved CMake implementation
2019-05-03 14:03:51 -07:00
Robert Ramey
27d3232cba corrections to documentation 2019-03-14 10:28:20 -07:00
Robert Ramey
273526b721 various documentation corrections 2019-03-10 12:18:42 -07:00
Robert Ramey
dec518c4a9 Fixed Exception Policies for trap and ignore. 2019-02-24 09:54:13 -08:00
Robert Ramey
a22cf75705 minor documentation corrections 2019-01-23 09:25:22 -08:00
Robert Ramey
f49e434238 Add tests for constexpr
improved CMake implementation for testing and development
2019-01-10 11:54:18 -08:00
Robert Ramey
0146d9fff8 changes to try to accommodate mdvc 32 bit version which can’t pass tests 2019-01-03 10:24:00 -08:00
Edward Diener
4c59dbc8b7 Merge branch 'develop' of https://github.com/eldiener/safe_numerics into leldgit 2018-12-20 10:12:10 -05:00
Robert Ramey
0dbc6a8d5b test fix for MSVC syntax problems 2018-12-15 10:03:59 -08:00
d3fault
19751af627 doc: fix misc typos and wording 2018-12-12 15:44:26 -07:00
Robert Ramey
a06d9f7a69 added constexpr tests to checked result operations
added tests for check result < and == operations
correct implementation of some checked result types
added constexpr example
2018-12-10 14:12:47 -08:00
Edward Diener
72f172d9eb Remove executable permission. 2018-12-03 08:02:03 -05:00
Robert Ramey
b9b394fe43 tribool has been updated so as not to implicitly convert tribool to bool 2018-09-23 14:26:36 -07:00
Robert Ramey
992bd7b311 Changes generated by preparation for CPPCon 2018 2018-09-15 10:48:41 -07:00
Robert Ramey
e26fb7fcee generated html and pdf documentation 2018-09-05 09:56:32 -07:00
Robert Ramey
52e0a2fe03 correction to exception expected
add example8 for difference between two unsigned ints
update documentation - pending issues
2018-09-04 13:37:21 -07:00
Robert Ramey
37457049a3 upgrades in documentation 2018-09-02 11:05:08 -07:00
Robert Ramey
4ed363972e moved include files to boost approved location 2018-08-14 21:27:37 -07:00
Robert Ramey
e68037cb32 Update documentation to address PRs
update appveyor/travis xml hoping they'll work
2018-08-14 16:46:19 -07:00
Robert Ramey
4e63548736 Refine embedded case study after running code on MPLab simulator 2018-08-10 13:07:38 -07:00
Robert Ramey
ffe8c9eaa2 add missing html files for case study
fix issue with CMakeLists.txt
2018-08-02 08:05:23 -07:00
Robert Ramey
b62ef86e28 Added case study for embedded system
corrections in cpp promotion
added make_safe_literal
separated integers from other types
dropped example91
updated CMakeLists.txt and Jamfile.v2 accordingly
2018-07-21 09:57:35 -07:00
Robert Ramey
53bd56c597 improved support for constexpr
improved support for safe_literals
corrected errors in less_than and equal which were failing to detect possible runtime failures.
simplified pseudo partial specialization for checked_result_operations
2018-05-19 15:59:28 -07:00
Robert Ramey
d8e3a5e0a8 build documentation 2018-04-24 21:48:33 -07:00
Robert Ramey
0d443e3a6f alterations to accomodate VS 2017
currently passes all tests and examples on Clang, gcc and mdvc with C++14
2018-04-23 10:22:34 -07:00
Robert Ramey
99ee93d94d refactored checked operations, added corresponding tests and documentation
meant to improve correctness and extendability.
2018-03-24 18:22:48 -07:00
Robert Ramey
0ff8bb9ceb Passing all tests.
checked integer arithmetic type working.
2018-03-22 10:12:39 -07:00
Robert Ramey
924ec15070 updated documentation to reflect newer implementation 2017-11-07 14:42:54 -08:00
Robert Ramey
67a7eaa2ad Make checked<...> an arithmetic type
adjust rest of program accordingly
this should
a) factor casts out of checked operations and put them in safe_base_operations
b) simplify interval which will not explicitly check for overflows etc.

First milestone - make test_add_native pass all addition tests.
2017-11-07 09:57:09 -08:00
Robert Ramey
4153b7f58a Numerous changes to better handle floating point.
Turns out that these changes should also better position us to handle other underlying types - but we're not there yet.
Added example for composition with other types - example boost rational and boost multi precision
Added performance test using boost multi precision
Many other small corrections
2017-07-16 13:36:09 -07:00
Robert Ramey
86910466a8 Intermediate working version
Making way for checked_float, checked_money, etc

a) factoring checked into checked_integer etc.
b) moved some tests from test_z to official tests
c) added test_rational which tests interoperability with boost::rational
d) moved safe_range to safe_integer_range
2017-07-08 12:48:37 -07:00
Robert Ramey
67bc38ac62 added example based on rational.hpp
used enable_if on checked functions to pave the way for other checked implementations
2017-06-27 22:56:11 -07:00
Robert Ramey
6854782928 reversed decision to make casting explicit. It's implicit again. Making it explicit didn't solve any issues but caused a number of examples to fail requiring an explanation. Now It's back to the way it was. 2017-06-25 21:19:58 -07:00
Robert Ramey
39e8c30097 used enable if on constructor so that it only gets instantiated when passed an integer type.
before this change, it would get instantiated by is_convertible<T, safe<U>> for any type T which created a syntax error.
This problem appears with using rational<safe<int>> but passes tests now.
Switched casting operators back to implicit.  Having it explicit makes it safe types more unwieldy to use and breaks some examples.
2017-06-25 11:46:11 -07:00
Robert Ramey
a1ea2eda24 eliminated implicit conversion from safe type to any other type.
updated documentation accordingly
2017-06-23 22:13:44 -07:00
Robert Ramey
38e72bd04f included checked::equal to trap when equal comparison fails due to changes in types 2017-06-12 21:20:38 -07:00
Robert Ramey
02b5bc79f8 update documentation changes for automatic promotion policy.
made code easier to read by replacing ! no_exception() with exception and no_exception with ! exception
2017-06-11 13:50:00 -07:00