mirror of
https://github.com/macports/macports-ports.git
synced 2026-07-12 18:20:25 -07:00
Some compilers complained when compiling code that includes <rapidjson/document.h>. Closes: https://trac.macports.org/ticket/70842
27 lines
1017 B
Diff
27 lines
1017 B
Diff
Fix:
|
|
|
|
error: cannot assign to non-static data member 'length' with const-qualified type 'const SizeType' (aka 'const unsigned int')
|
|
|
|
https://github.com/Tencent/rapidjson/issues/718
|
|
https://github.com/Tencent/rapidjson/pull/719
|
|
--- include/rapidjson/document.h.orig
|
|
+++ include/rapidjson/document.h
|
|
@@ -316,8 +316,6 @@ struct GenericStringRef {
|
|
|
|
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; }
|
|
|
|
@@ -328,6 +326,8 @@ struct GenericStringRef {
|
|
//! Disallow construction from non-const array
|
|
template<SizeType N>
|
|
GenericStringRef(CharType (&str)[N]) /* = delete */;
|
|
+ //! Copy assignment operator not permitted - immutable type
|
|
+ GenericStringRef& operator=(const GenericStringRef& rhs) /* = delete */;
|
|
};
|
|
|
|
//! Mark a character pointer as constant string
|