mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-25 15:21:54 +00:00
Specialize MakeUnsigned for all signed integer types.
This commit is contained in:
parent
d81fafc295
commit
be9356b651
13
format.h
13
format.h
@ -424,13 +424,16 @@ struct IntTraits {
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
struct MakeUnsigned { typedef T Type; };
|
struct MakeUnsigned { typedef T Type; };
|
||||||
|
|
||||||
#define SPECIALIZE_MAKE_UNSIGNED(T) \
|
#define SPECIALIZE_MAKE_UNSIGNED(T, U) \
|
||||||
template <> \
|
template <> \
|
||||||
struct MakeUnsigned<signed T> { typedef unsigned T Type; }
|
struct MakeUnsigned<T> { typedef U Type; }
|
||||||
|
|
||||||
SPECIALIZE_MAKE_UNSIGNED(char);
|
SPECIALIZE_MAKE_UNSIGNED(char, unsigned char);
|
||||||
SPECIALIZE_MAKE_UNSIGNED(short);
|
SPECIALIZE_MAKE_UNSIGNED(signed char, unsigned char);
|
||||||
SPECIALIZE_MAKE_UNSIGNED(long);
|
SPECIALIZE_MAKE_UNSIGNED(short, unsigned short);
|
||||||
|
SPECIALIZE_MAKE_UNSIGNED(int, unsigned);
|
||||||
|
SPECIALIZE_MAKE_UNSIGNED(long, unsigned long);
|
||||||
|
SPECIALIZE_MAKE_UNSIGNED(LongLong, ULongLong);
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct IsLongDouble { enum {VALUE = 0}; };
|
struct IsLongDouble { enum {VALUE = 0}; };
|
||||||
|
Loading…
Reference in New Issue
Block a user