summaryrefslogtreecommitdiff
path: root/value.h
diff options
context:
space:
mode:
Diffstat (limited to 'value.h')
-rw-r--r--value.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/value.h b/value.h
index 39a258b5..10775b1e 100644
--- a/value.h
+++ b/value.h
@@ -46,6 +46,18 @@ class value_t
*((unsigned int *) data) = value;
type = INTEGER;
}
+ value_t(const double value) {
+ new((amount_t *) data) amount_t(value);
+ type = AMOUNT;
+ }
+ value_t(const std::string& value) {
+ new((amount_t *) data) amount_t(value);
+ type = AMOUNT;
+ }
+ value_t(const char * value) {
+ new((amount_t *) data) amount_t(value);
+ type = AMOUNT;
+ }
value_t(const amount_t& value) {
new((amount_t *)data) amount_t(value);
type = AMOUNT;
@@ -80,6 +92,15 @@ class value_t
}
return *this;
}
+ value_t& operator=(const double value) {
+ return *this = amount_t(value);
+ }
+ value_t& operator=(const std::string& value) {
+ return *this = amount_t(value);
+ }
+ value_t& operator=(const char * value) {
+ return *this = amount_t(value);
+ }
value_t& operator=(const amount_t& value) {
if ((amount_t *) data != &value) {
if (! value) {