Fix invalid type in Pointer
Fixed https://github.com/miloyip/rapidjson-gitbook/issues/1
This commit is contained in:
parent
daabb88e00
commit
672e7dd373
@ -537,14 +537,14 @@ public:
|
|||||||
*/
|
*/
|
||||||
ValueType& GetWithDefault(ValueType& root, const ValueType& defaultValue, typename ValueType::AllocatorType& allocator) const {
|
ValueType& GetWithDefault(ValueType& root, const ValueType& defaultValue, typename ValueType::AllocatorType& allocator) const {
|
||||||
bool alreadyExist;
|
bool alreadyExist;
|
||||||
Value& v = Create(root, allocator, &alreadyExist);
|
ValueType& v = Create(root, allocator, &alreadyExist);
|
||||||
return alreadyExist ? v : v.CopyFrom(defaultValue, allocator);
|
return alreadyExist ? v : v.CopyFrom(defaultValue, allocator);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Query a value in a subtree with default null-terminated string.
|
//! Query a value in a subtree with default null-terminated string.
|
||||||
ValueType& GetWithDefault(ValueType& root, const Ch* defaultValue, typename ValueType::AllocatorType& allocator) const {
|
ValueType& GetWithDefault(ValueType& root, const Ch* defaultValue, typename ValueType::AllocatorType& allocator) const {
|
||||||
bool alreadyExist;
|
bool alreadyExist;
|
||||||
Value& v = Create(root, allocator, &alreadyExist);
|
ValueType& v = Create(root, allocator, &alreadyExist);
|
||||||
return alreadyExist ? v : v.SetString(defaultValue, allocator);
|
return alreadyExist ? v : v.SetString(defaultValue, allocator);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -552,7 +552,7 @@ public:
|
|||||||
//! Query a value in a subtree with default std::basic_string.
|
//! Query a value in a subtree with default std::basic_string.
|
||||||
ValueType& GetWithDefault(ValueType& root, const std::basic_string<Ch>& defaultValue, typename ValueType::AllocatorType& allocator) const {
|
ValueType& GetWithDefault(ValueType& root, const std::basic_string<Ch>& defaultValue, typename ValueType::AllocatorType& allocator) const {
|
||||||
bool alreadyExist;
|
bool alreadyExist;
|
||||||
Value& v = Create(root, allocator, &alreadyExist);
|
ValueType& v = Create(root, allocator, &alreadyExist);
|
||||||
return alreadyExist ? v : v.SetString(defaultValue, allocator);
|
return alreadyExist ? v : v.SetString(defaultValue, allocator);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user