mirror of
https://github.com/fmtlib/fmt.git
synced 2024-10-02 13:02:03 +00:00
parent
af8a180aed
commit
712abe40f2
@ -910,7 +910,8 @@ template <typename Char> struct named_arg_info {
|
|||||||
template <typename T, typename Char, size_t NUM_ARGS, size_t NUM_NAMED_ARGS>
|
template <typename T, typename Char, size_t NUM_ARGS, size_t NUM_NAMED_ARGS>
|
||||||
struct arg_data {
|
struct arg_data {
|
||||||
// args_[0].named_args points to named_args_ to avoid bloating format_args.
|
// args_[0].named_args points to named_args_ to avoid bloating format_args.
|
||||||
T args_[1 + (NUM_ARGS != 0 ? NUM_ARGS : 1)];
|
// +1 to workaround a bug in gcc 7.5 that causes duplicated-branches warning.
|
||||||
|
T args_[1 + (NUM_ARGS != 0 ? NUM_ARGS : +1)];
|
||||||
named_arg_info<Char> named_args_[NUM_NAMED_ARGS];
|
named_arg_info<Char> named_args_[NUM_NAMED_ARGS];
|
||||||
|
|
||||||
template <typename... U>
|
template <typename... U>
|
||||||
@ -922,7 +923,8 @@ struct arg_data {
|
|||||||
|
|
||||||
template <typename T, typename Char, size_t NUM_ARGS>
|
template <typename T, typename Char, size_t NUM_ARGS>
|
||||||
struct arg_data<T, Char, NUM_ARGS, 0> {
|
struct arg_data<T, Char, NUM_ARGS, 0> {
|
||||||
T args_[NUM_ARGS != 0 ? NUM_ARGS : 1];
|
// +1 to workaround a bug in gcc 7.5 that causes duplicated-branches warning.
|
||||||
|
T args_[NUM_ARGS != 0 ? NUM_ARGS : +1];
|
||||||
|
|
||||||
template <typename... U>
|
template <typename... U>
|
||||||
FMT_INLINE arg_data(const U&... init) : args_{init...} {}
|
FMT_INLINE arg_data(const U&... init) : args_{init...} {}
|
||||||
|
Loading…
Reference in New Issue
Block a user