Merge pull request #182 from 2017zhangyuxuan/patch-1

Mod: add "_len" initiation
This commit is contained in:
Francis
2022-04-10 16:29:39 +08:00
committed by GitHub

View File

@@ -42,7 +42,7 @@ public:
}
// copy ctor
MyStringNoMove(const MyStringNoMove &str) {
MyStringNoMove(const MyStringNoMove &str) : _len(str._len) {
++CCtor;
_init_data(str._data);
}
@@ -118,7 +118,7 @@ public:
}
// copy ctor
MyString(const MyString &str) {
MyString(const MyString &str) : _len(str._len) {
++CCtor;
_init_data(str._data);
}
@@ -279,4 +279,4 @@ int main() {
// test_moveable(multiset<MyString>(), multiset<MyStringNoMove>(), value);
// test_moveable(unordered_multiset<MyString>(), unordered_multiset<MyStringNoMove>(), value);
return 0;
}
}