Skip to content

Commit e61fea0

Browse files
committed
fix: rule of five for concoredocker.hpp
1 parent b6cfcaa commit e61fea0

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

concoredocker.hpp

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,38 @@ class Concore {
5353
load_params();
5454
}
5555

56+
Concore(const Concore&) = delete;
57+
Concore& operator=(const Concore&) = delete;
58+
59+
Concore(Concore&& other) noexcept
60+
: iport(std::move(other.iport)), oport(std::move(other.oport)),
61+
s(std::move(other.s)), olds(std::move(other.olds)),
62+
delay(other.delay), retrycount(other.retrycount),
63+
inpath(std::move(other.inpath)), outpath(std::move(other.outpath)),
64+
simtime(other.simtime), maxtime(other.maxtime),
65+
params(std::move(other.params))
66+
{}
67+
68+
Concore& operator=(Concore&& other) noexcept
69+
{
70+
if (this == &other)
71+
return *this;
72+
73+
iport = std::move(other.iport);
74+
oport = std::move(other.oport);
75+
s = std::move(other.s);
76+
olds = std::move(other.olds);
77+
delay = other.delay;
78+
retrycount = other.retrycount;
79+
inpath = std::move(other.inpath);
80+
outpath = std::move(other.outpath);
81+
simtime = other.simtime;
82+
maxtime = other.maxtime;
83+
params = std::move(other.params);
84+
85+
return *this;
86+
}
87+
5688
std::unordered_map<std::string, std::string> safe_literal_eval(const std::string& filename, std::unordered_map<std::string, std::string> defaultValue) {
5789
std::ifstream file(filename);
5890
if (!file) return defaultValue;

0 commit comments

Comments
 (0)