diff options
author | Olivier Gayot <og@satcom1.com> | 2017-11-18 14:56:31 +0100 |
---|---|---|
committer | Olivier Gayot <og@satcom1.com> | 2017-11-19 14:01:08 +0100 |
commit | f5331e02dd2e10c20cb562aa7940747e860411b0 (patch) | |
tree | 4422de9cfb014208963bf91e1feb43f09b4ef3a3 /number.cpp | |
parent | eb1d6d72fe5e501c7b980789eae8aec4b04fa71f (diff) |
Added pre-increment operator and += operator
Signed-off-by: Olivier Gayot <og@satcom1.com>
Diffstat (limited to 'number.cpp')
-rw-r--r-- | number.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -149,6 +149,25 @@ number::operator!=(const number &n) const } /* }}} */ +/* Assignment operators {{{ */ + +number & +number::operator+=(const number &n) +{ + *this = *this + n; + + return *this; +} + +number & +number::operator++() +{ + *this = *this + 1; + + return *this; +} + +/* }}} */ std::ostream & operator<<(std::ostream &os, const number &n) |