diff options
author | John Wiegley <johnw@newartisans.com> | 2004-09-14 05:05:56 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2004-09-14 05:05:56 -0400 |
commit | bd72c0cf908492abb99a1419f7f8136729747061 (patch) | |
tree | 2ee9bfbf02c94fa9fdf4cd344901e4cc48e65a0a /value.h | |
parent | a013b520ba151b9da3adec97d124676a96741b04 (diff) | |
download | fork-ledger-bd72c0cf908492abb99a1419f7f8136729747061.tar.gz fork-ledger-bd72c0cf908492abb99a1419f7f8136729747061.tar.bz2 fork-ledger-bd72c0cf908492abb99a1419f7f8136729747061.zip |
added more math operators for value_t types
Diffstat (limited to 'value.h')
-rw-r--r-- | value.h | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -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) { |