summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--number.cpp6
-rw-r--r--number.h3
2 files changed, 9 insertions, 0 deletions
diff --git a/number.cpp b/number.cpp
index 26b0ed2..acd60fd 100644
--- a/number.cpp
+++ b/number.cpp
@@ -145,3 +145,9 @@ number::operator!=(const number &n) const
}
/* }}} */
+
+std::ostream &
+operator<<(std::ostream &os, const number &n)
+{
+ return os << n.to_hex_string();
+}
diff --git a/number.h b/number.h
index e7eebb5..8489453 100644
--- a/number.h
+++ b/number.h
@@ -1,6 +1,7 @@
#pragma once
#include <list>
+#include <ostream>
#include <cstdint>
@@ -77,3 +78,5 @@ private:
/* First item is the least significant. */
std::list<std::uint64_t> _operands;
};
+
+std::ostream &operator<<(std::ostream &, const number &);