diff options
Diffstat (limited to 'libjsonpp/jsonpp.h')
-rw-r--r-- | libjsonpp/jsonpp.h | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/libjsonpp/jsonpp.h b/libjsonpp/jsonpp.h index d56ca99..1a57389 100644 --- a/libjsonpp/jsonpp.h +++ b/libjsonpp/jsonpp.h @@ -18,18 +18,27 @@ namespace json { typedef double Number; typedef bool Boolean; class Null { }; - class Value; - typedef std::map<std::string, Value> Object; - typedef std::list<Value> Array; - typedef std::variant<Null, String, Number, Object, Array, Boolean> VT; - class Value : public VT { + class Object; + class Array; + typedef std::variant<Null, String, Number, Object, Array, Boolean> Value; + typedef std::map<std::string, Value> M; + class Object : public M { public: - Value() : VT(Null()) { } - - template <class X> - Value(const X & x) : VT(x) { } + using M::M; + }; + typedef std::list<Value> A; + class Array : public A { + public: + using A::A; }; + static_assert(std::is_move_constructible<Value>::value); + static_assert(std::is_nothrow_move_constructible<Object>::value); + static_assert(std::is_nothrow_move_constructible<Array>::value); + static_assert(std::is_move_assignable<Value>::value); + static_assert(std::is_nothrow_move_assignable<Object>::value); + static_assert(std::is_nothrow_move_assignable<Array>::value); + Value parseValue(std::istream &); Value parseValue(std::istream &, const std::string & encoding); Value parseValue(const Glib::ustring & s); |