summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Gayot <og@satcom1.com>2017-11-18 14:31:27 +0100
committerOlivier Gayot <og@satcom1.com>2017-11-19 14:01:08 +0100
commiteb1d6d72fe5e501c7b980789eae8aec4b04fa71f (patch)
tree63532eb0f0da311c4f7c5a1bded581b81f71cdd9
parenta78c788171d45057406b571846e55541eef49688 (diff)
Added constructors to copy and create a number from an integer
Signed-off-by: Olivier Gayot <og@satcom1.com>
-rw-r--r--number.cpp4
-rw-r--r--number.h4
2 files changed, 8 insertions, 0 deletions
diff --git a/number.cpp b/number.cpp
index bd05dbf..c337a34 100644
--- a/number.cpp
+++ b/number.cpp
@@ -2,6 +2,10 @@
#include <sstream>
#include "number.h"
+number::number(std::uint32_t n):
+ _operands{n}
+{ }
+
/* Type Conversion {{{ */
std::string
diff --git a/number.h b/number.h
index 97817ac..252428a 100644
--- a/number.h
+++ b/number.h
@@ -8,6 +8,10 @@
class number {
public:
number() = default;
+ number(const number &) = default;
+ number(number &&) = default;
+
+ number(std::uint32_t);
/**
* \brief Return a hexadecimal string representation of this number.