CDImage: Relational operators for Position

This commit is contained in:
Connor McLaughlin 2019-10-27 00:01:25 +10:00
parent 88eec0a56b
commit f9e964e34d

View file

@ -76,6 +76,21 @@ public:
*this = *this + pos; *this = *this + pos;
return *this; return *this;
} }
#define RELATIONAL_OPERATOR(op) \
bool operator##op(const Position& rhs) const \
{ \
return std::tie(minute, second, frame) op std::tie(rhs.minute, rhs.second, rhs.frame); \
}
RELATIONAL_OPERATOR(==);
RELATIONAL_OPERATOR(!=);
RELATIONAL_OPERATOR(<);
RELATIONAL_OPERATOR(<=);
RELATIONAL_OPERATOR(>);
RELATIONAL_OPERATOR(>=);
#undef RELATIONAL_OPERATOR
}; };
// Opening disc image. // Opening disc image.