Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/miloyip/rapidjson.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Lyngmo <ted@lyncon.se>2017-03-08 08:25:41 +0300
committerTed Lyngmo <ted@lyncon.se>2017-03-08 11:47:38 +0300
commitef22ca17321933eb2bd54ff7975657babab18cdd (patch)
tree58668c73cb343ff2a955f8d9ff2f0e9ac55ce816 /example
parentc64f378f16f23742b316e99d6fe40a3c14f95698 (diff)
Fix -Werror=effc++ errors with GNU 6.3.1
Fix "'MyHandler::type’ should be initialized in the member initialization list [-Werror=effc++]" errors. https://github.com/miloyip/rapidjson/issues/874
Diffstat (limited to 'example')
-rw-r--r--example/simplepullreader/simplepullreader.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/example/simplepullreader/simplepullreader.cpp b/example/simplepullreader/simplepullreader.cpp
index 14018295..a4fb1161 100644
--- a/example/simplepullreader/simplepullreader.cpp
+++ b/example/simplepullreader/simplepullreader.cpp
@@ -16,13 +16,7 @@ struct MyHandler {
const char* type;
std::string data;
- MyHandler() : type(), data() { Null(); }
- MyHandler(const MyHandler& cpy) : type(cpy.type),data(cpy.data) {}
- MyHandler& operator=(const MyHandler& cpy) {
- type = cpy.type;
- data = cpy.data;
- return *this;
- }
+ MyHandler() : type(), data() {}
bool Null() { type = "Null"; data.clear(); return true; }
bool Bool(bool b) { type = "Bool:"; data = b? "true": "false"; return true; }
@@ -38,6 +32,9 @@ struct MyHandler {
bool EndObject(SizeType memberCount) { type = "EndObject:"; data = stringify(memberCount); return true; }
bool StartArray() { type = "StartArray"; data.clear(); return true; }
bool EndArray(SizeType elementCount) { type = "EndArray:"; data = stringify(elementCount); return true; }
+private:
+ MyHandler(const MyHandler& noCopyConstruction);
+ MyHandler& operator=(const MyHandler& noAssignment);
};
int main() {