From eb1d6d72fe5e501c7b980789eae8aec4b04fa71f Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Sat, 18 Nov 2017 14:31:27 +0100 Subject: Added constructors to copy and create a number from an integer Signed-off-by: Olivier Gayot --- number.cpp | 4 ++++ number.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/number.cpp b/number.cpp index bd05dbf..c337a34 100644 --- a/number.cpp +++ b/number.cpp @@ -2,6 +2,10 @@ #include #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. -- cgit v1.2.3