From cb4e2934297a5139b783a3eb9641e0ceec34d738 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=85=E6=88=8E=E6=B0=8F?= Date: Mon, 8 Apr 2024 00:32:01 +0800 Subject: [PATCH] constexpr doesn't work here --- include/WeaselUtility.h | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/include/WeaselUtility.h b/include/WeaselUtility.h index c45d62d97..00db2481e 100644 --- a/include/WeaselUtility.h +++ b/include/WeaselUtility.h @@ -86,34 +86,34 @@ inline std::string wstring_to_string(const std::wstring& wstr, template struct EscapeChar { - static constexpr CharT escape; - static constexpr CharT linefeed; - static constexpr CharT tab; - static constexpr CharT linefeed_escape; - static constexpr CharT tab_escape; + static const CharT escape; + static const CharT linefeed; + static const CharT tab; + static const CharT linefeed_escape; + static const CharT tab_escape; }; template <> -constexpr char EscapeChar::escape = '\\'; +const char EscapeChar::escape = '\\'; template <> -constexpr char EscapeChar::linefeed = '\n'; +const char EscapeChar::linefeed = '\n'; template <> -constexpr char EscapeChar::tab = '\t'; +const char EscapeChar::tab = '\t'; template <> -constexpr char EscapeChar::linefeed_escape = 'n'; +const char EscapeChar::linefeed_escape = 'n'; template <> -constexpr char EscapeChar::tab_escape = 't'; +const char EscapeChar::tab_escape = 't'; template <> -constexpr char EscapeChar::escape = L'\\'; +const char EscapeChar::escape = L'\\'; template <> -constexpr char EscapeChar::linefeed = L'\n'; +const char EscapeChar::linefeed = L'\n'; template <> -constexpr char EscapeChar::tab = L'\t'; +const char EscapeChar::tab = L'\t'; template <> -constexpr char EscapeChar::linefeed_escape = L'n'; +const char EscapeChar::linefeed_escape = L'n'; template <> -constexpr char EscapeChar::tab_escape = L't'; +const char EscapeChar::tab_escape = L't'; template inline std::basic_string escape_string(