SMTSolverChoice: Rewrite operator & not to modify its argument

This commit is contained in:
Kamil Śliwak 2021-09-17 19:41:34 +02:00
parent 588ec39eef
commit b3a513d3b6

View File

@ -65,7 +65,7 @@ struct SMTSolverChoice
return solvers; return solvers;
} }
SMTSolverChoice& operator&(SMTSolverChoice const& _other) SMTSolverChoice& operator&=(SMTSolverChoice const& _other)
{ {
cvc4 &= _other.cvc4; cvc4 &= _other.cvc4;
smtlib2 &= _other.smtlib2; smtlib2 &= _other.smtlib2;
@ -73,9 +73,10 @@ struct SMTSolverChoice
return *this; return *this;
} }
SMTSolverChoice& operator&=(SMTSolverChoice const& _other) SMTSolverChoice operator&(SMTSolverChoice _other) const noexcept
{ {
return *this & _other; _other &= *this;
return _other;
} }
bool operator!=(SMTSolverChoice const& _other) const noexcept { return !(*this == _other); } bool operator!=(SMTSolverChoice const& _other) const noexcept { return !(*this == _other); }