From ed9cdbc2f7f78d9936e5236632608c2589e84125 Mon Sep 17 00:00:00 2001 From: "Philipp A. Hartmann" Date: Mon, 7 Jul 2014 11:26:19 +0200 Subject: [PATCH] GenericStringRef: disallow assignment, const string pointer --- include/rapidjson/document.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h index 44cf532e..33c97f48 100644 --- a/include/rapidjson/document.h +++ b/include/rapidjson/document.h @@ -270,10 +270,12 @@ struct GenericStringRef { //! implicit conversion to plain CharType pointer operator const Ch *() const { return s; } - const Ch* s; //!< plain CharType pointer + const Ch* const s; //!< plain CharType pointer const SizeType length; //!< length of the string (excluding the trailing NULL terminator) private: + //! Disallow copy-assignment + GenericStringRef operator=(const GenericStringRef&); //! Disallow construction from non-const array template GenericStringRef(CharType (&str)[N]) /* = delete */;