From 5c7474e1fb7e94d5c563363f4b244ec27095139a Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sun, 4 Feb 2018 08:58:21 -0800 Subject: [PATCH] Relax constexpr requirements --- include/fmt/core.h | 4 ++-- include/fmt/format.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/fmt/core.h b/include/fmt/core.h index cfb27ddf..1dd6944b 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -50,10 +50,10 @@ #endif #if FMT_USE_CONSTEXPR # define FMT_CONSTEXPR constexpr -# define FMT_CONSTEXPR_VAR constexpr +# define FMT_CONSTEXPR_DECL constexpr #else # define FMT_CONSTEXPR inline -# define FMT_CONSTEXPR_VAR +# define FMT_CONSTEXPR_DECL #endif #ifndef FMT_OVERRIDE diff --git a/include/fmt/format.h b/include/fmt/format.h index ff7a90d6..04850fd2 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -636,7 +636,7 @@ class null_terminating_iterator { return ptr_ >= other.ptr_; } - friend FMT_CONSTEXPR const Char *pointer_from( + friend FMT_CONSTEXPR_DECL const Char *pointer_from( null_terminating_iterator it); private: @@ -3216,7 +3216,7 @@ template inline typename std::enable_if< std::is_base_of::value, std::string>::type format(String format_str, const Args & ... args) { - FMT_CONSTEXPR_VAR bool invalid_format = + FMT_CONSTEXPR_DECL bool invalid_format = internal::check_format_string( string_view(format_str.value(), format_str.size())); (void)invalid_format; @@ -3243,8 +3243,8 @@ class udl_formatter { public: template std::basic_string operator()(const Args &... args) const { - FMT_CONSTEXPR_VAR Char s[] = {CHARS..., '\0'}; - FMT_CONSTEXPR_VAR bool invalid_format = + FMT_CONSTEXPR_DECL Char s[] = {CHARS..., '\0'}; + FMT_CONSTEXPR_DECL bool invalid_format = check_format_string( basic_string_view(s, sizeof...(CHARS))); (void)invalid_format;