Skip to content

Commit c64f378

Browse files
committed
Fix -Werror=effc++ errors with GNU 6.3.1
Fix "'MyHandler::type’ should be initialized in the member initialization list [-Werror=effc++]" errors. Tencent#874
1 parent a1fac15 commit c64f378

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

example/simplepullreader/simplepullreader.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ struct MyHandler {
1616
const char* type;
1717
std::string data;
1818

19+
MyHandler() : type(), data() { Null(); }
20+
MyHandler(const MyHandler& cpy) : type(cpy.type),data(cpy.data) {}
21+
MyHandler& operator=(const MyHandler& cpy) {
22+
type = cpy.type;
23+
data = cpy.data;
24+
return *this;
25+
}
26+
1927
bool Null() { type = "Null"; data.clear(); return true; }
2028
bool Bool(bool b) { type = "Bool:"; data = b? "true": "false"; return true; }
2129
bool Int(int i) { type = "Int:"; data = stringify(i); return true; }

0 commit comments

Comments
 (0)