Add serialisers for float and int

This commit is contained in:
Danny Robson 2013-08-05 22:39:34 +10:00
parent 8b7f915c01
commit d425f1c67a

View File

@ -580,4 +580,16 @@ namespace json {
io<std::string>::serialise (const std::string &s) { io<std::string>::serialise (const std::string &s) {
return std::unique_ptr<node> (new string (s)); return std::unique_ptr<node> (new string (s));
} }
template <>
std::unique_ptr<node>
io<int>::serialise (const int &i) {
return std::unique_ptr<node> (new number (i));
}
template <>
std::unique_ptr<node>
io<float>::serialise (const float &f) {
return std::unique_ptr<node> (new number (f));
}
} }