From 849c9f6168b28e2a1cb46546163e65617a99171d Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Thu, 6 May 2021 08:12:24 -0700 Subject: [PATCH] Move is_name_start to core --- include/fmt/core.h | 4 ++++ include/fmt/format.h | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/fmt/core.h b/include/fmt/core.h index 2ecb4db6..e17e0702 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -1927,6 +1927,10 @@ FMT_CONSTEXPR const Char* parse_align(const Char* begin, const Char* end, struct auto_id {}; +template FMT_CONSTEXPR bool is_name_start(Char c) { + return ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || '_' == c; +} + template FMT_CONSTEXPR const Char* do_parse_arg_id(const Char* begin, const Char* end, IDHandler&& handler) { diff --git a/include/fmt/format.h b/include/fmt/format.h index 45e8df26..76fe1444 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -2263,10 +2263,6 @@ class arg_formatter : public arg_formatter_base { } }; -template FMT_CONSTEXPR bool is_name_start(Char c) { - return ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || '_' == c; -} - template class custom_formatter { private: using char_type = typename Context::char_type;