Add sign_types specialisation for size_t/ssize_t

This commit is contained in:
Danny Robson 2011-06-23 22:06:52 +10:00
parent 898d082fb0
commit 212dcbfbd8

View File

@ -70,6 +70,18 @@ template <> struct sign_types <unsigned int> {
};
template <> struct sign_types <ssize_t> {
typedef ssize_t with_sign;
typedef size_t without_sign;
};
template <> struct sign_types <size_t> {
typedef ssize_t with_sign;
typedef size_t without_sign;
};
/// Safely cast a numeric type to its signed comparison, aborting if the
/// result is not representable.
template <typename T>