Skip to content

Commit

Permalink
Fix C++03 compilation error about sizeof()
Browse files Browse the repository at this point in the history
  • Loading branch information
miloyip committed Feb 15, 2016
1 parent 4bb6f2c commit 49c982b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/rapidjson/document.h
Expand Up @@ -1676,7 +1676,7 @@ class GenericValue {
// 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<Flag*>(0)->payload) / sizeof(Ch), MaxSize = MaxChars - 1, LenPos = MaxSize };
Ch str[MaxChars];

inline static bool Usable(SizeType len) { return (MaxSize >= len); }
Expand Down

0 comments on commit 49c982b

Please sign in to comment.