diff --git a/lib/json/reflector.h b/lib/json/reflector.h index 3de7f37..bb201be 100644 --- a/lib/json/reflector.h +++ b/lib/json/reflector.h @@ -166,11 +166,11 @@ inline void push(Type reflectable, RAPIDJSON_NAMESPACE::Value &value, RAPIDJSON_ /*! * \brief Pushes the specified C-string to the specified value. */ -template > * = nullptr> +template , std::is_same> * = nullptr> inline void push(Type reflectable, RAPIDJSON_NAMESPACE::Value &value, RAPIDJSON_NAMESPACE::Document::AllocatorType &allocator) { if (reflectable) { - value.SetString(RAPIDJSON_NAMESPACE::StringRef(reflectable), allocator); + value.SetString(reflectable, allocator); } else { value.SetNull(); } @@ -183,28 +183,19 @@ template > inline void push(Type reflectable, RAPIDJSON_NAMESPACE::Value &value, RAPIDJSON_NAMESPACE::Document::AllocatorType &allocator) { if (reflectable.data()) { - value.SetString(RAPIDJSON_NAMESPACE::StringRef(reflectable.data(), reflectable.size()), allocator); + value.SetString(reflectable.data(), rapidJsonSize(reflectable.size()), allocator); } else { value.SetNull(); } } -/*! - * \brief Pushes the specified constant C-string to the specified value. - */ -template > * = nullptr> -inline void push(const char *const &reflectable, RAPIDJSON_NAMESPACE::Value &value, RAPIDJSON_NAMESPACE::Document::AllocatorType &allocator) -{ - value.SetString(RAPIDJSON_NAMESPACE::StringRef(reflectable), allocator); -} - /*! * \brief Pushes the specified std::string to the specified value. */ template > * = nullptr> inline void push(const Type &reflectable, RAPIDJSON_NAMESPACE::Value &value, RAPIDJSON_NAMESPACE::Document::AllocatorType &allocator) { - value.SetString(RAPIDJSON_NAMESPACE::StringRef(reflectable.data(), reflectable.size()), allocator); + value.SetString(reflectable.data(), rapidJsonSize(reflectable.size()), allocator); } /*!