summaryrefslogtreecommitdiff
path: root/src/balance.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2007-05-07 10:27:29 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 03:38:40 -0400
commit6ec2f6b59be2fe8e621e97a39836e7033fd0f240 (patch)
treee84984047da8e00d9ac9697fe4ecb354e3190028 /src/balance.h
parentd8498372037a4d0c272547ae48046b2182bcd4b1 (diff)
downloadfork-ledger-6ec2f6b59be2fe8e621e97a39836e7033fd0f240.tar.gz
fork-ledger-6ec2f6b59be2fe8e621e97a39836e7033fd0f240.tar.bz2
fork-ledger-6ec2f6b59be2fe8e621e97a39836e7033fd0f240.zip
Reconfigure some of the operators.
Diffstat (limited to 'src/balance.h')
-rw-r--r--src/balance.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/balance.h b/src/balance.h
index a7c95870..40f1eec0 100644
--- a/src/balance.h
+++ b/src/balance.h
@@ -41,7 +41,9 @@ class balance_t
equality_comparable<balance_t, amount_t,
additive<balance_t,
additive<balance_t, amount_t,
- multiplicative<balance_t, amount_t> > > > >
+ multiplicative<balance_t, amount_t,
+ multiplicative<balance_t, unsigned long,
+ multiplicative<balance_t, long> > > > > > >
{
public:
typedef std::map<const commodity_t *, amount_t> amounts_map;
@@ -235,7 +237,9 @@ class balance_pair_t
additive<balance_pair_t,
additive<balance_pair_t, balance_t,
additive<balance_pair_t, amount_t,
- multiplicative<balance_pair_t, amount_t> > > > > > >
+ multiplicative<balance_pair_t, unsigned long,
+ multiplicative<balance_pair_t, long,
+ multiplicative<balance_pair_t, amount_t> > > > > > > > >
{
balance_t quantity;
optional<balance_t> cost;
@@ -298,6 +302,9 @@ public:
bool operator==(const balance_t& bal) const {
return quantity == bal;
}
+ bool operator==(const amount_t& amt) const {
+ return quantity == amt;
+ }
balance_pair_t& operator*=(const amount_t& amt) {
quantity *= amt;