From 672e7dd3732417971e41c0a3d0161e43d1b37db3 Mon Sep 17 00:00:00 2001 From: Milo Yip Date: Mon, 12 Feb 2018 10:16:27 +0800 Subject: [PATCH] Fix invalid type in Pointer Fixed https://github.com/miloyip/rapidjson-gitbook/issues/1 --- include/rapidjson/pointer.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/rapidjson/pointer.h b/include/rapidjson/pointer.h index 217e71c..8bcb85e 100644 --- a/include/rapidjson/pointer.h +++ b/include/rapidjson/pointer.h @@ -537,14 +537,14 @@ public: */ ValueType& GetWithDefault(ValueType& root, const ValueType& defaultValue, typename ValueType::AllocatorType& allocator) const { bool alreadyExist; - Value& v = Create(root, allocator, &alreadyExist); + ValueType& v = Create(root, allocator, &alreadyExist); return alreadyExist ? v : v.CopyFrom(defaultValue, allocator); } //! Query a value in a subtree with default null-terminated string. ValueType& GetWithDefault(ValueType& root, const Ch* defaultValue, typename ValueType::AllocatorType& allocator) const { bool alreadyExist; - Value& v = Create(root, allocator, &alreadyExist); + ValueType& v = Create(root, allocator, &alreadyExist); return alreadyExist ? v : v.SetString(defaultValue, allocator); } @@ -552,7 +552,7 @@ public: //! Query a value in a subtree with default std::basic_string. ValueType& GetWithDefault(ValueType& root, const std::basic_string& defaultValue, typename ValueType::AllocatorType& allocator) const { bool alreadyExist; - Value& v = Create(root, allocator, &alreadyExist); + ValueType& v = Create(root, allocator, &alreadyExist); return alreadyExist ? v : v.SetString(defaultValue, allocator); } #endif