From c64f378f16f23742b316e99d6fe40a3c14f95698 Mon Sep 17 00:00:00 2001 From: Ted Lyngmo Date: Wed, 8 Mar 2017 06:25:41 +0100 Subject: [PATCH] Fix -Werror=effc++ errors with GNU 6.3.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix "'MyHandler::type’ should be initialized in the member initialization list [-Werror=effc++]" errors. https://github.com/miloyip/rapidjson/issues/874 --- example/simplepullreader/simplepullreader.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/example/simplepullreader/simplepullreader.cpp b/example/simplepullreader/simplepullreader.cpp index 98566e6..1401829 100644 --- a/example/simplepullreader/simplepullreader.cpp +++ b/example/simplepullreader/simplepullreader.cpp @@ -16,6 +16,14 @@ 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; + } + bool Null() { type = "Null"; data.clear(); return true; } bool Bool(bool b) { type = "Bool:"; data = b? "true": "false"; return true; } bool Int(int i) { type = "Int:"; data = stringify(i); return true; }