Skip to content

Commit 8956c97

Browse files
authored
Fix rule-of-5 for uApp (#1914)
1 parent 7b38a1f commit 8956c97

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/App.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,15 @@ struct TemplatedApp {
239239
});
240240
}
241241

242+
TemplatedApp& operator=(const TemplatedApp&) = delete;
243+
244+
TemplatedApp& operator=(TemplatedApp&& other) {
245+
std::swap(this->httpContext, other.httpContext);
246+
std::swap(this->topicTree, other.topicTree);
247+
std::swap(this->webSocketContextDeleters, other.webSocketContextDeleters);
248+
std::swap(this->webSocketContexts, other.webSocketContexts);
249+
}
250+
242251
bool constructorFailed() {
243252
return !httpContext;
244253
}

0 commit comments

Comments
 (0)