Skip to content

Commit 672e7dd

Browse files
committed
Fix invalid type in Pointer
Fixed miloyip/rapidjson-gitbook#1
1 parent daabb88 commit 672e7dd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

include/rapidjson/pointer.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -537,22 +537,22 @@ class GenericPointer {
537537
*/
538538
ValueType& GetWithDefault(ValueType& root, const ValueType& defaultValue, typename ValueType::AllocatorType& allocator) const {
539539
bool alreadyExist;
540-
Value& v = Create(root, allocator, &alreadyExist);
540+
ValueType& v = Create(root, allocator, &alreadyExist);
541541
return alreadyExist ? v : v.CopyFrom(defaultValue, allocator);
542542
}
543543

544544
//! Query a value in a subtree with default null-terminated string.
545545
ValueType& GetWithDefault(ValueType& root, const Ch* defaultValue, typename ValueType::AllocatorType& allocator) const {
546546
bool alreadyExist;
547-
Value& v = Create(root, allocator, &alreadyExist);
547+
ValueType& v = Create(root, allocator, &alreadyExist);
548548
return alreadyExist ? v : v.SetString(defaultValue, allocator);
549549
}
550550

551551
#if RAPIDJSON_HAS_STDSTRING
552552
//! Query a value in a subtree with default std::basic_string.
553553
ValueType& GetWithDefault(ValueType& root, const std::basic_string<Ch>& defaultValue, typename ValueType::AllocatorType& allocator) const {
554554
bool alreadyExist;
555-
Value& v = Create(root, allocator, &alreadyExist);
555+
ValueType& v = Create(root, allocator, &alreadyExist);
556556
return alreadyExist ? v : v.SetString(defaultValue, allocator);
557557
}
558558
#endif

0 commit comments

Comments
 (0)