From 5f61ed8fcb994cf053ca170e91f93aa389f034a8 Mon Sep 17 00:00:00 2001 From: Krystie Date: Sat, 9 May 2026 19:32:44 -0700 Subject: [PATCH] Fix C++20 type-tag and string timestamp regressions --- src/serialize.h | 6 +++--- src/util.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/serialize.h b/src/serialize.h index 9420d63..d4a2f74 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -406,7 +406,7 @@ unsigned int GetSerializeSize_impl(const std::vector& v, int nType, int nV template inline unsigned int GetSerializeSize(const std::vector& v, int nType, int nVersion) { - return GetSerializeSize_impl(v, nType, nVersion, std::is_fundamental_v); + return GetSerializeSize_impl(v, nType, nVersion, std::is_fundamental{}); } @@ -429,7 +429,7 @@ void Serialize_impl(Stream& os, const std::vector& v, int nType, int nVers template inline void Serialize(Stream& os, const std::vector& v, int nType, int nVersion) { - Serialize_impl(os, v, nType, nVersion, std::is_fundamental_v); + Serialize_impl(os, v, nType, nVersion, std::is_fundamental{}); } @@ -470,7 +470,7 @@ void Unserialize_impl(Stream& is, std::vector& v, int nType, int nVersion, template inline void Unserialize(Stream& is, std::vector& v, int nType, int nVersion) { - Unserialize_impl(is, v, nType, nVersion, std::is_fundamental_v); + Unserialize_impl(is, v, nType, nVersion, std::is_fundamental{}); } diff --git a/src/util.h b/src/util.h index c7bbe01..5a70338 100644 --- a/src/util.h +++ b/src/util.h @@ -405,10 +405,10 @@ inline std::string DateTimeStrFormat(const char* pszFormat, int64_t nTime) return pszTime; } -constexpr std::string_view strTimestampFormat = "%Y-%m-%d %H:%M:%S UTC"; +constexpr const char strTimestampFormat[] = "%Y-%m-%d %H:%M:%S UTC"; inline std::string DateTimeStrFormat(int64_t nTime) { - return DateTimeStrFormat(strTimestampFormat.c_str(), nTime); + return DateTimeStrFormat(strTimestampFormat, nTime); }