Skip to content

Commit

Permalink
Merge pull request Light-City#182 from 2017zhangyuxuan/patch-1
Browse files Browse the repository at this point in the history
Mod: add "_len" initiation
  • Loading branch information
Light-City committed Apr 10, 2022
2 parents ba3694d + e76957a commit 5d23c9d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions c++2.0/c++11/move.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class MyStringNoMove {
}

// copy ctor
MyStringNoMove(const MyStringNoMove &str) {
MyStringNoMove(const MyStringNoMove &str) : _len(str._len) {
++CCtor;
_init_data(str._data);
}
Expand Down Expand Up @@ -118,7 +118,7 @@ class MyString {
}

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

0 comments on commit 5d23c9d

Please sign in to comment.