From 098a8fdef853dabcaca17b927a768b0e1d68cb22 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Thu, 25 Sep 2014 07:14:08 -0700 Subject: [PATCH] Simplify make_type --- format.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/format.h b/format.h index d936d63a..afbce247 100644 --- a/format.h +++ b/format.h @@ -1243,12 +1243,9 @@ struct ArgType { ArgType(const T &arg) : type(make_type(arg)) {} }; -inline ULongLong make_type( - ArgType t0, ArgType t1, ArgType t2 = ArgType(), ArgType t3 = ArgType(), - ArgType t4 = ArgType(), ArgType t5 = ArgType(), ArgType t6 = ArgType(), - ArgType t7 = ArgType(), ArgType t8 = ArgType(), ArgType t9 = ArgType(), - ArgType t10 = ArgType(), ArgType t11 = ArgType(), ArgType t12 = ArgType(), - ArgType t13 = ArgType(), ArgType t14 = ArgType()) { +# define FMT_ARG_TYPE_DEFAULT(n) ArgType t##n = ArgType() + +inline ULongLong make_type(FMT_GEN15(FMT_ARG_TYPE_DEFAULT)) { return t0.type | (t1.type << 4) | (t2.type << 8) | (t3.type << 12) | (t4.type << 16) | (t5.type << 20) | (t6.type << 24) | (t7.type << 28) | (t8.type << 32) | (t9.type << 36) | (t10.type << 40) | (t11.type << 44) |