Commit Graph

33 Commits

Author SHA1 Message Date
Robert Ramey
1bc0b94e65 changes to implement the following:
a) made trap_exception work
b) updated manual and examples to show how to use library to eliminate runtime penalty
c) added in safe_literal
d) made corrections of various types
2015-12-21 23:14:06 -08:00
Robert Ramey
5ed3f3a945 attempt to get division with automatic type promotion working 2015-09-05 17:16:19 -07:00
Robert Ramey
64c3203ae1 Fixed compilation error in native
made automatic tests pass for addition
2015-07-20 12:33:29 -07:00
Robert Ramey
9bd6684c23 progress on automatic promotion policy 2015-07-18 15:38:05 -07:00
Robert Ramey
97d2b6cf12 made transition from derived classes to usage of type alias
pending cast from safe type to primitive integer type
2015-06-27 09:58:53 -07:00
Robert Ramey
2a5c0e373c test0 not working
example6 not working
2015-06-25 08:44:38 -07:00
Robert Ramey
2ebf9538d1 broke multiply and conversion 2015-06-23 15:16:04 -07:00
Robert Ramey
00e39147a4 Resolve problems with documentation
a) missing concepts
b) missing examples
c) rationalized types
2015-06-10 22:46:58 -07:00
Robert Ramey
5eebc2f1a8 working tests add and subtract with policies 2015-06-08 13:15:37 -07:00
Robert Ramey
7299770bdf miscellaaneous code clean up
added policies documentation
2015-06-02 22:42:39 -07:00
Robert Ramey
471f1b85ec got test_checked to work.
This verifies error detection for instrinsic integers at both compile and run time
2015-05-29 13:06:45 -07:00
Robert Ramey
7ce25ab9c0 testing constexpr for calculation of compile time overflows.
Turns out that clang doesn't just overflow - it traps if there's an overflow - basically like safe<int> does at compile time.
Upshot is we have to trap overflows at compile time WITHOUT calculating them.  In retrospect this is undefined behavior but no matter.
Next iteration will deal with this.
2015-03-12 18:18:08 -07:00
Robert Ramey
599debeace passing all addition tests 2015-03-06 22:08:46 -08:00
Robert Ramey
273d32e4df works for subtract and add 2015-02-22 14:48:30 -08:00
Robert Ramey
fcb107840b addition operator returns safe type - passes all current addition tests.
implemented policy design
implemented addition part of native policy
2015-02-16 21:06:40 -08:00
Robert Ramey
561efa82a8 latest version - problem with circular reference to limits.hpp 2014-08-31 15:06:36 -07:00
Robert Ramey
d5c921a55b managed to get native.hpp to compile - but still have problems production a safe result 2014-07-11 14:46:31 -07:00
Robert Ramey
72fa8a1a28 temp commit 2014-07-06 13:34:33 -07:00
Robert Ramey
01a51ffea8 psses test.copp 2014-07-06 11:07:24 -07:00
Robert Ramey
24af3a8a7e compiles test.cpp w/o errors
implements safe_tag to distinguish "safe" types
2014-07-06 09:40:11 -07:00
Robert Ramey
831231d9de intermediate version - first look at policies 2014-07-04 08:49:57 -07:00
Robert Ramey
557ffc61ad first cut at policies - not there yet 2014-07-01 13:31:25 -07:00
Robert Ramey
c2c093379d adjustments to make test_conversion pass
All tests pass in Debug and Release!!!
2014-04-20 18:10:15 -07:00
Robert Ramey
2bfc6d4381 fix subtraction
passes all tests
2014-04-20 15:24:08 -07:00
Robert Ramey
742f536338 improve local operations - no tests for these yet 2014-04-16 11:07:30 -07:00
Robert Ramey
ee09a4371b test divide passes 2014-04-15 16:25:20 -07:00
Robert Ramey
da574497e5 working
test add
test cast
test compare
test conversion
test subtract
test multiply
2014-04-14 14:41:48 -07:00
Robert Ramey
257f806f0b working:
test_multiply
test_cast
2014-04-13 20:18:27 -07:00
Robert Ramey
cef6bcd465 intermediat changes
almost have safe multiplication working.  Fails 4 test cases.  BUT these cases require more than trivial changes so I'm checking in this intermediate version
2014-04-11 11:27:20 -07:00
Robert Ramey
09d3149412 Got all tests for subtraction to pass. 2014-04-08 08:22:22 -07:00
Robert Ramey
12f5843f90 Fixed problems in testing addition operations
More carefully defined the concepts.  That is the concept of the library is now clear:

Trap at either compile or runtime integer operations which yield a result which differs from the normal arithmetic result.

Pending on this check in:
a) only addition is fixed up so far
b) uses BOOST_TYPEOF... rather than decltype(... - final decision sill pending.
c) comments out some compile time checks which should be re-instated.
d) fixed tests so that they actually work!
2014-04-05 12:22:25 -07:00
Robert Ramey
050f6748b9 minor adjustments in tests from Clang testing 2014-02-11 14:37:31 -08:00
Robert Ramey
b9845327d1 eliminated redundant root directory 2013-11-04 11:44:56 -08:00