Skip to content

Commit

Permalink
LineHypothesis: Add copy assignment operator
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
stweil committed Oct 18, 2018
1 parent 9c2d1aa commit 0bbd5c5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/ccmain/paragraphs_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ struct LineHypothesis {
LineHypothesis(const LineHypothesis &other)
: ty(other.ty), model(other.model) {}

// Copy assignment operator.
LineHypothesis& operator=(const LineHypothesis& other) {
ty = other.ty;
model = other.model;
return *this;
}

bool operator==(const LineHypothesis &other) const {
return ty == other.ty && model == other.model;
}
Expand Down

0 comments on commit 0bbd5c5

Please sign in to comment.