Home

Arithmetic operators

Comparison operators

bool operator==(const X& lhs, const X& rhs){ /* do actual comparison */ }
bool operator!=(const X& lhs, const X& rhs){return !operator==(lhs,rhs);}
bool operator< (const X& lhs, const X& rhs){ /* do actual comparison */ }
bool operator> (const X& lhs, const X& rhs){return  operator< (rhs,lhs);}
bool operator<=(const X& lhs, const X& rhs){return !operator> (lhs,rhs);}
bool operator>=(const X& lhs, const X& rhs){return !operator<(lhs,rhs);}
CSCI 221 material by Joshua Eckroth is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. Source code for this website available at GitHub.