Add always_unsigned type conversion template

This commit is contained in:
Danny Robson 2012-05-25 15:30:11 +10:00
parent f9cc4926f2
commit 4899f08772

View File

@ -40,4 +40,11 @@ template <typename T> struct dereferenced_type<std::shared_ptr<T>> { typedef T t
template <typename T> struct dereferenced_type<std::weak_ptr<T>> { typedef T type; }; template <typename T> struct dereferenced_type<std::weak_ptr<T>> { typedef T type; };
template <typename T> struct dereferenced_type<std::auto_ptr<T>> { typedef T type; }; template <typename T> struct dereferenced_type<std::auto_ptr<T>> { typedef T type; };
template <typename T> struct always_unsigned {
typedef typename std::make_unsigned<T>::type type;
};
template <> struct always_unsigned<double> { typedef double type; };
template <> struct always_unsigned<float > { typedef float type; };
#endif #endif