mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-30 08:53:08 +01:00
fix in62_t equality/inequality operators when used with mismatched arguments
This commit is contained in:
parent
bb9376c2b1
commit
4f6befea83
1 changed files with 7 additions and 2 deletions
|
|
@ -113,8 +113,13 @@ class alignas(16) int62_t {
|
|||
bool operator<= (int62_t const & other) const { if (flagged() != other.flagged()) throw flag_mismatch(); return val() <= other.val(); }
|
||||
bool operator> (int62_t const & other) const { if (flagged() != other.flagged()) throw flag_mismatch(); return val() > other.val(); }
|
||||
bool operator>= (int62_t const & other) const { if (flagged() != other.flagged()) throw flag_mismatch(); return val() >= other.val(); }
|
||||
bool operator!= (int62_t const & other) const { if (flagged() != other.flagged()) throw flag_mismatch(); return val() != other.val(); }
|
||||
bool operator== (int62_t const & other) const { if (flagged() != other.flagged()) throw flag_mismatch(); return val() == other.val(); }
|
||||
|
||||
/* don't throw flag_mismatch for explicit equality checks, since
|
||||
* the semantics are well defined and the computation cost is trivial
|
||||
*/
|
||||
|
||||
bool operator!= (int62_t const & other) const { if (flagged() != other.flagged()) return false; return val() != other.val(); }
|
||||
bool operator== (int62_t const & other) const { if (flagged() != other.flagged()) return true; return val() == other.val(); }
|
||||
|
||||
explicit operator int64_t() const { return int62(v); }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue