summaryrefslogtreecommitdiff
path: root/amount.h
diff options
context:
space:
mode:
Diffstat (limited to 'amount.h')
-rw-r--r--amount.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/amount.h b/amount.h
index 8716ad34..665dabe9 100644
--- a/amount.h
+++ b/amount.h
@@ -185,6 +185,7 @@ public:
}
explicit amount_t(const char * val) : quantity(NULL) {
TRACE_CTOR(amount_t, "const char *");
+ assert(val);
parse(val);
}
@@ -229,10 +230,21 @@ public:
}
amount_t& operator=(const amount_t& amt);
+ amount_t& operator=(const double val) {
+ return *this = amount_t(val);
+ }
+ amount_t& operator=(const unsigned long val) {
+ return *this = amount_t(val);
+ }
+ amount_t& operator=(const long val) {
+ return *this = amount_t(val);
+ }
+
amount_t& operator=(const string& str) {
return *this = amount_t(str);
}
amount_t& operator=(const char * str) {
+ assert(str);
return *this = amount_t(str);
}