From 175f8972d894085c3c8e42c6952d1172315df382 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=B8=D1=80=D0=B8=D0=BB=D0=BB=20=D0=97=D0=B8=D0=BC?= =?UTF-8?q?=D0=BD=D0=B8=D0=BA=D0=BE=D0=B2?= Date: Tue, 7 Apr 2020 10:43:32 +0700 Subject: [PATCH] Add missed MOVESET for simple types Without that my compiller GCC 9.3.0 says: `undefined reference to `void picojson::value::set(double&&)'` when i try set any value like this: ``` picojson::value val(); val.set(5.); ``` --- picojson.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/picojson.h b/picojson.h index 346cf05..25b5876 100644 --- a/picojson.h +++ b/picojson.h @@ -415,9 +415,14 @@ SET(int64_t, int64, u_.int64_ = _val;) type_ = jtype##_type; \ setter \ } +MOVESET(bool, boolean, u_.boolean_ = std::move(_val);) MOVESET(std::string, string, u_.string_ = new std::string(std::move(_val));) MOVESET(array, array, u_.array_ = new array(std::move(_val));) MOVESET(object, object, u_.object_ = new object(std::move(_val));) +MOVESET(double, number, u_.number_ = std::move(_val);) +#ifdef PICOJSON_USE_INT64 +MOVESET(int64_t, int64, u_.int64_ = std::move(_val);) +#endif #undef MOVESET #endif