Skip to content

Commit 0bbd5c5

Browse files
committed
LineHypothesis: Add copy assignment operator
This fixes a warning from LGTM: No matching copy assignment operator in class LineHypothesis. It is good practice to match a copy constructor with a copy assignment operator. Signed-off-by: Stefan Weil <[email protected]>
1 parent 9c2d1aa commit 0bbd5c5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/ccmain/paragraphs_internal.h

+7
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,13 @@ struct LineHypothesis {
7979
LineHypothesis(const LineHypothesis &other)
8080
: ty(other.ty), model(other.model) {}
8181

82+
// Copy assignment operator.
83+
LineHypothesis& operator=(const LineHypothesis& other) {
84+
ty = other.ty;
85+
model = other.model;
86+
return *this;
87+
}
88+
8289
bool operator==(const LineHypothesis &other) const {
8390
return ty == other.ty && model == other.model;
8491
}

0 commit comments

Comments
 (0)