json: serialisation/instantiation from size_t
This commit is contained in:
parent
61ee601df1
commit
fcd40105a7
@ -586,6 +586,12 @@ namespace json {
|
||||
return std::unique_ptr<node> (new number (i));
|
||||
}
|
||||
|
||||
template <>
|
||||
std::unique_ptr<node>
|
||||
io<size_t>::serialise (const size_t &i) {
|
||||
return std::unique_ptr<node> (new number (i));
|
||||
}
|
||||
|
||||
template <>
|
||||
std::unique_ptr<node>
|
||||
io<float>::serialise (const float &f) {
|
||||
|
1
json.hpp
1
json.hpp
@ -190,6 +190,7 @@ namespace json {
|
||||
public:
|
||||
explicit number (double _value): m_value (_value) { ; }
|
||||
explicit number (int _value): m_value (_value) { ; }
|
||||
explicit number (size_t _value): m_value (_value) { ; }
|
||||
|
||||
virtual const number& as_number (void) const { return *this; }
|
||||
virtual bool is_number (void) const { return true; }
|
||||
|
Loading…
Reference in New Issue
Block a user