aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorErik Åldstedt Sund <erik.sund@conoptica.com>2017-10-23 22:59:08 +0200
committerErik Åldstedt Sund <erik.sund@conoptica.com>2017-10-30 20:47:48 +0100
commitecbbd0ebf2204bae8ca968007c7408b6e2ae2a75 (patch)
tree014c6262dbed0b5f8794497c89617c9a850ada44 /include
parent4fe7dd171a77747f1b14654acd369381d6eb3f17 (diff)
downloadcrow-ecbbd0ebf2204bae8ca968007c7408b6e2ae2a75.tar.gz
crow-ecbbd0ebf2204bae8ca968007c7408b6e2ae2a75.zip
Fixed ostream operator for big integers
Diffstat (limited to 'include')
-rw-r--r--include/crow/json.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/crow/json.h b/include/crow/json.h
index bdef117..1f28af5 100644
--- a/include/crow/json.h
+++ b/include/crow/json.h
@@ -656,7 +656,17 @@ namespace crow
case type::Null: os << "null"; break;
case type::False: os << "false"; break;
case type::True: os << "true"; break;
- case type::Number: os << r.d(); break;
+ case type::Number:
+ {
+ switch (r.nt())
+ {
+ case num_type::Floating_point: os << r.d(); break;
+ case num_type::Signed_integer: os << r.i(); break;
+ case num_type::Unsigned_integer: os << r.u(); break;
+ case num_type::Null: throw std::runtime_error("Number with num_type Null");
+ }
+ }
+ break;
case type::String: os << '"' << r.s() << '"'; break;
case type::List:
{