Add always_unsigned type conversion template
This commit is contained in:
parent
f9cc4926f2
commit
4899f08772
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user