summaryrefslogtreecommitdiff
path: root/value.h
diff options
context:
space:
mode:
Diffstat (limited to 'value.h')
-rw-r--r--value.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/value.h b/value.h
index 617b5fb7..819f985f 100644
--- a/value.h
+++ b/value.h
@@ -250,6 +250,23 @@ class value_t
};
template <typename T>
+value_t operator+(const T& value, const value_t& obj) {
+ return value_t(value) + obj;
+}
+template <typename T>
+value_t operator-(const T& value, const value_t& obj) {
+ return value_t(value) - obj;
+}
+template <typename T>
+value_t operator*(const T& value, const value_t& obj) {
+ return value_t(value) * obj;
+}
+template <typename T>
+value_t operator/(const T& value, const value_t& obj) {
+ return value_t(value) / obj;
+}
+
+template <typename T>
value_t::operator T() const
{
switch (type) {