mirror of
https://github.com/Tencent/rapidjson.git
synced 2025-10-29 20:59:48 +01:00
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
This commit is contained in:
@@ -16,6 +16,14 @@ struct MyHandler {
|
|||||||
const char* type;
|
const char* type;
|
||||||
std::string data;
|
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 Null() { type = "Null"; data.clear(); return true; }
|
||||||
bool Bool(bool b) { type = "Bool:"; data = b? "true": "false"; 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; }
|
bool Int(int i) { type = "Int:"; data = stringify(i); return true; }
|
||||||
|
|||||||
Reference in New Issue
Block a user