From d425f1c67af7b4fbd4d5a0958be71b7d9aabf22a Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Mon, 5 Aug 2013 22:39:34 +1000 Subject: [PATCH] Add serialisers for float and int --- json.cpp.rl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/json.cpp.rl b/json.cpp.rl index b2881e04..650852cd 100644 --- a/json.cpp.rl +++ b/json.cpp.rl @@ -580,4 +580,16 @@ namespace json { io::serialise (const std::string &s) { return std::unique_ptr (new string (s)); } + + template <> + std::unique_ptr + io::serialise (const int &i) { + return std::unique_ptr (new number (i)); + } + + template <> + std::unique_ptr + io::serialise (const float &f) { + return std::unique_ptr (new number (f)); + } }