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]).
This commit is contained in:
Tomek Rozen 2017-05-15 10:48:49 +02:00 committed by Victor Zverovich
parent 0284a2893a
commit e14bac62a0

View File

@ -2214,10 +2214,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];
@ -2235,7 +2235,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