Skip to content

Commit 92a1e1f

Browse files
committed
SH, history tracking
1 parent c124b35 commit 92a1e1f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tests/test_class_sh_shared_ptr_copy_move.cpp

+10-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,16 @@ template <int SerNo>
1515
struct Foo {
1616
std::string history;
1717
Foo(const std::string &history_) : history(history_) {}
18-
Foo(const Foo &other) = delete;
19-
Foo(Foo &&other) = delete;
18+
Foo(const Foo &other) : history(other.history + "_CpCtor") {}
19+
Foo(Foo &&other) : history(other.history + "_MvCtor") {}
20+
Foo &operator=(const Foo &other) {
21+
history = other.history + "_OpEqLv";
22+
return *this;
23+
}
24+
Foo &operator=(Foo &&other) {
25+
history = other.history + "_OpEqRv";
26+
return *this;
27+
}
2028
std::string get_history() const { return "Foo" + fooNames[SerNo] + history; }
2129
};
2230

0 commit comments

Comments
 (0)