From f5331e02dd2e10c20cb562aa7940747e860411b0 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Sat, 18 Nov 2017 14:56:31 +0100 Subject: Added pre-increment operator and += operator Signed-off-by: Olivier Gayot --- number.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'number.h') diff --git a/number.h b/number.h index 252428a..c905287 100644 --- a/number.h +++ b/number.h @@ -11,6 +11,8 @@ public: number(const number &) = default; number(number &&) = default; + number &operator=(const number &) = default; + number(std::uint32_t); /** @@ -78,6 +80,18 @@ public: */ bool operator!=(const number &n) const; + /** + * \brief Add a number to this number. + * + * \param n Number to add to this number. + */ + number &operator+=(const number &n); + + /** + * \brief Increment this number. + */ + number &operator++(); + private: /* First item is the least significant. */ std::list _operands; -- cgit v1.2.3