diff options
author | John Wiegley <johnw@newartisans.com> | 2008-07-17 21:22:24 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-07-17 21:22:24 -0400 |
commit | 30fb235841276f32c233bc8d41369a937d1f32be (patch) | |
tree | 7dfad7c51a0cfa9753c7551d8ad421282380497b /balance.h | |
parent | 6cb519231fba70ae5b84c1ae60aa8a653b14aa2e (diff) | |
download | fork-ledger-30fb235841276f32c233bc8d41369a937d1f32be.tar.gz fork-ledger-30fb235841276f32c233bc8d41369a937d1f32be.tar.bz2 fork-ledger-30fb235841276f32c233bc8d41369a937d1f32be.zip |
Added helper methods for comparing a balance to a balance_pair.
Diffstat (limited to 'balance.h')
-rw-r--r-- | balance.h | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -926,6 +926,22 @@ class balance_pair_t temp.cost = new balance_t(cost->unround()); return temp; } + + friend inline bool operator<(const balance_t& bal, const balance_pair_t& bal_pair) { + return bal_pair >= bal; + } + friend inline bool operator<=(const balance_t& bal, const balance_pair_t& bal_pair) { + return bal_pair > bal; + } + friend inline bool operator>(const balance_t& bal, const balance_pair_t& bal_pair) { + return bal_pair <= bal; + } + friend inline bool operator>=(const balance_t& bal, const balance_pair_t& bal_pair) { + return bal_pair < bal; + } + friend inline bool operator==(const balance_t& bal, const balance_pair_t& bal_pair) { + return bal_pair == bal; + } }; inline balance_pair_t abs(const balance_pair_t& bal_pair) { |