mirror of
https://github.com/fmtlib/fmt.git
synced 2025-07-30 10:47:35 +02:00
Changing ArgArray template argument from unsigned to size_t
Each instantiation of ArgArray template uses sizeof operator, which
returns a std::size_t value. GCC 7.1 warns about invalid conversion
(error: conversion to ‘unsigned int’ from ‘long unsigned
int’ may alter its value [-Werror=conversion]).
(cherry picked from commit e14bac62a0
)
This commit is contained in:
committed by
Jonathan Müller
parent
ecd0994c15
commit
c75f6dcd30
@ -2157,10 +2157,10 @@ inline uint64_t make_type(const T &arg) {
|
||||
return MakeValue< BasicFormatter<char> >::type(arg);
|
||||
}
|
||||
|
||||
template <unsigned N, bool/*IsPacked*/= (N < ArgList::MAX_PACKED_ARGS)>
|
||||
template <std::size_t N, bool/*IsPacked*/= (N < ArgList::MAX_PACKED_ARGS)>
|
||||
struct ArgArray;
|
||||
|
||||
template <unsigned N>
|
||||
template <std::size_t N>
|
||||
struct ArgArray<N, true/*IsPacked*/> {
|
||||
typedef Value Type[N > 0 ? N : 1];
|
||||
|
||||
@ -2178,7 +2178,7 @@ struct ArgArray<N, true/*IsPacked*/> {
|
||||
}
|
||||
};
|
||||
|
||||
template <unsigned N>
|
||||
template <std::size_t N>
|
||||
struct ArgArray<N, false/*IsPacked*/> {
|
||||
typedef Arg Type[N + 1]; // +1 for the list end Arg::NONE
|
||||
|
||||
|
Reference in New Issue
Block a user