Commit Graph

8 Commits

Author SHA1 Message Date
6910ef10b9 New sign_cast implementation using SFINAE
* Uses enable_if to guarantee same size types for argument/return
* Uses type_traits to check signedness for specialisation
2011-07-05 22:55:18 +10:00
128d46d9ad Use explicit sized integer types for sign_types<T>
When we used size_t/ssize_t they conflicted with the system's word sized
integers. This should work well for all the numeric types we're likely
to see.
2011-07-03 16:08:36 +10:00
212dcbfbd8 Add sign_types specialisation for size_t/ssize_t 2011-06-23 22:06:52 +10:00
898d082fb0 Expand brief documentation for classes 2011-06-23 22:06:28 +10:00
c8804cbe8e Added generic hton and ntoh functions 2011-06-21 23:36:51 +10:00
f924c990df Add template based elems implementation 2011-06-21 20:16:39 +10:00
4891c6af0e Add sign_cast functions
These safely cast between signed and unsigned numeric quantities,
aborting if the result cannot be safely converted (as opposed to size
expanding or throwing).
2011-06-15 22:38:58 +10:00
745e06d1af initial import from waif 2011-05-23 17:18:52 +10:00