From a138221813e3ea931e55e628672a304331965b52 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sun, 19 Apr 2020 08:12:27 -0700 Subject: [PATCH] Always inline arg_data functions --- include/fmt/core.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/include/fmt/core.h b/include/fmt/core.h index 45bb134f..bd0d099b 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -172,7 +172,7 @@ #ifndef FMT_INLINE # if FMT_GCC_VERSION -# define FMT_INLINE __attribute__((always_inline)) +# define FMT_INLINE inline __attribute__((always_inline)) # else # define FMT_INLINE # endif @@ -795,9 +795,10 @@ template struct arg_data { T args_[NUM_ARGS != 0 ? NUM_ARGS : 1]; - template arg_data(const U&... init) : args_{init...} {} - const T* args() const { return args_; } - std::nullptr_t named_args() { return nullptr; } + template + FMT_INLINE arg_data(const U&... init) : args_{init...} {} + FMT_INLINE const T* args() const { return args_; } + FMT_INLINE std::nullptr_t named_args() { return nullptr; } }; template @@ -818,7 +819,7 @@ void init_named_args(named_arg_info* named_args, int arg_count, } template -void init_named_args(std::nullptr_t, int, int, const Args&...) {} +FMT_INLINE void init_named_args(std::nullptr_t, int, int, const Args&...) {} template struct is_named_arg : std::false_type {};