From 212dcbfbd8600eae8eabb22ff811ffc6ee7aed04 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Thu, 23 Jun 2011 22:06:52 +1000 Subject: [PATCH] Add sign_types specialisation for size_t/ssize_t --- types.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/types.hpp b/types.hpp index 3077fcf5..5e5d8c40 100644 --- a/types.hpp +++ b/types.hpp @@ -70,6 +70,18 @@ template <> struct sign_types { }; +template <> struct sign_types { + typedef ssize_t with_sign; + typedef size_t without_sign; +}; + + +template <> struct sign_types { + 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