From 49c982b4b71a479d94650e7eb5b5290320c833a3 Mon Sep 17 00:00:00 2001 From: Milo Yip Date: Mon, 15 Feb 2016 12:19:30 +0800 Subject: [PATCH] Fix C++03 compilation error about sizeof() --- include/rapidjson/document.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h index 6aead38..63cca99 100644 --- a/include/rapidjson/document.h +++ b/include/rapidjson/document.h @@ -1676,7 +1676,7 @@ private: // This allows to store 13-chars strings in 32-bit mode, 21-chars strings in 64-bit mode, // 13-chars strings for RAPIDJSON_48BITPOINTER_OPTIMIZATION=1 inline (for `UTF8`-encoded strings). struct ShortString { - enum { MaxChars = sizeof(Flag::payload) / sizeof(Ch), MaxSize = MaxChars - 1, LenPos = MaxSize }; + enum { MaxChars = sizeof(static_cast(0)->payload) / sizeof(Ch), MaxSize = MaxChars - 1, LenPos = MaxSize }; Ch str[MaxChars]; inline static bool Usable(SizeType len) { return (MaxSize >= len); }