summaryrefslogtreecommitdiff
path: root/src/amount.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2007-05-16 10:46:05 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 03:38:53 -0400
commit2d8512af88eab26176089e53916f309f2d3b3be4 (patch)
tree5d0b6217a3367099d8a3fdb2866acc433c38e078 /src/amount.h
parent1134fc7eff7094700abf16c2e532d7c3c40ae68d (diff)
downloadledger-2d8512af88eab26176089e53916f309f2d3b3be4.tar.gz
ledger-2d8512af88eab26176089e53916f309f2d3b3be4.tar.bz2
ledger-2d8512af88eab26176089e53916f309f2d3b3be4.zip
Changed all uses of scope_t * to scope_t&
Diffstat (limited to 'src/amount.h')
-rw-r--r--src/amount.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/amount.h b/src/amount.h
index c11f539b..0ca290a8 100644
--- a/src/amount.h
+++ b/src/amount.h
@@ -177,11 +177,11 @@ public:
amount_t(const unsigned long val);
amount_t(const long val);
- amount_t(const string& val) : quantity(NULL) {
+ explicit amount_t(const string& val) : quantity(NULL) {
TRACE_CTOR(amount_t, "const string&");
parse(val);
}
- amount_t(const char * val) : quantity(NULL) {
+ explicit amount_t(const char * val) : quantity(NULL) {
TRACE_CTOR(amount_t, "const char *");
parse(val);
}
@@ -216,7 +216,7 @@ public:
* causing the result to compare equal to the reference amount.
*
* Note: `quantity' must be initialized to NULL first, otherwise the
- * `_copy' function will attempt to release the unitialized pointer.
+ * `_copy' function will attempt to release the uninitialized pointer.
*/
amount_t(const amount_t& amt) : quantity(NULL) {
TRACE_CTOR(amount_t, "copy");
@@ -227,6 +227,13 @@ public:
}
amount_t& operator=(const amount_t& amt);
+ amount_t& operator=(const string& str) {
+ return *this = amount_t(str);
+ }
+ amount_t& operator=(const char * str) {
+ return *this = amount_t(str);
+ }
+
/**
* Comparison operators. The fundamental comparison operation for
* amounts is `compare', which returns a value less than, greater