From be5a886f8fedf6f963d277bba32e57ae6d232d76 Mon Sep 17 00:00:00 2001 From: Milo Yip Date: Wed, 6 Apr 2016 00:34:45 +0800 Subject: [PATCH] Fix clang compilation error --- include/rapidjson/document.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h index dda799c..2d9bfe6 100644 --- a/include/rapidjson/document.h +++ b/include/rapidjson/document.h @@ -312,6 +312,10 @@ struct GenericStringRef { GenericStringRef(const CharType* str, SizeType len) : s(str), length(len) { RAPIDJSON_ASSERT(s != 0); } + GenericStringRef(const GenericStringRef& rhs) : s(rhs.s), length(rhs.length) {} + + GenericStringRef& operator=(const GenericStringRef& rhs) { s = rhs.s; length = rhs.length; } + //! implicit conversion to plain CharType pointer operator const Ch *() const { return s; } @@ -322,8 +326,6 @@ private: //! Disallow construction from non-const array template GenericStringRef(CharType (&str)[N]) /* = delete */; - - GenericStringRef& operator=(const GenericStringRef&); }; //! Mark a character pointer as constant string