From f5e9b8699d087be0753fb86d6eb0dd790fda36f3 Mon Sep 17 00:00:00 2001 From: Alexey Ochapov Date: Sun, 27 Dec 2020 08:08:14 +0300 Subject: [PATCH] revert back `FMT_INLINE` removed in #2056 --- include/fmt/core.h | 19 +++++++++++-------- include/fmt/format.h | 2 +- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/include/fmt/core.h b/include/fmt/core.h index f2309b8867a1..28b7bc6c6f34 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -946,9 +946,9 @@ struct arg_data { T args_[NUM_ARGS != 0 ? NUM_ARGS : +1]; template - FMT_CONSTEXPR arg_data(const U&... init) : args_{init...} {} - FMT_CONSTEXPR const T* args() const { return args_; } - FMT_CONSTEXPR std::nullptr_t named_args() { return nullptr; } + FMT_CONSTEXPR FMT_INLINE arg_data(const U&... init) : args_{init...} {} + FMT_CONSTEXPR FMT_INLINE const T* args() const { return args_; } + FMT_CONSTEXPR FMT_INLINE std::nullptr_t named_args() { return nullptr; } }; template @@ -969,7 +969,8 @@ void init_named_args(named_arg_info* named_args, int arg_count, } template -FMT_CONSTEXPR void init_named_args(std::nullptr_t, int, int, const Args&...) {} +FMT_CONSTEXPR FMT_INLINE void init_named_args(std::nullptr_t, int, int, + const Args&...) {} template struct is_named_arg : std::false_type {}; @@ -1090,11 +1091,11 @@ template class value { FMT_INLINE value(long double val) : long_double_value(val) {} constexpr FMT_INLINE value(bool val) : bool_value(val) {} constexpr FMT_INLINE value(char_type val) : char_value(val) {} - FMT_CONSTEXPR value(const char_type* val) { + FMT_CONSTEXPR FMT_INLINE value(const char_type* val) { string.data = val; if (is_constant_evaluated()) string.size = {}; } - FMT_CONSTEXPR value(basic_string_view val) { + FMT_CONSTEXPR FMT_INLINE value(basic_string_view val) { string.data = val.data(); string.size = val.size(); } @@ -1685,7 +1686,8 @@ template class basic_format_args { \endrst */ template - constexpr basic_format_args(const format_arg_store& store) + constexpr FMT_INLINE basic_format_args( + const format_arg_store& store) : basic_format_args(store.desc, store.data_.args()) {} /** @@ -1694,7 +1696,8 @@ template class basic_format_args { `~fmt::dynamic_format_arg_store`. \endrst */ - constexpr basic_format_args(const dynamic_format_arg_store& store) + constexpr FMT_INLINE basic_format_args( + const dynamic_format_arg_store& store) : basic_format_args(store.get_types(), store.data()) {} /** diff --git a/include/fmt/format.h b/include/fmt/format.h index d6084fba7ee3..1e5860ff5bc4 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -2317,7 +2317,7 @@ class arg_formatter_base { } template ::value)> - FMT_CONSTEXPR iterator operator()(T value) { + FMT_CONSTEXPR FMT_INLINE iterator operator()(T value) { if (specs_) write_int(value, *specs_); else