mirror of
https://github.com/Tencent/rapidjson.git
synced 2025-03-09 03:03:38 +01:00
Merge pull request #681 from niukuo/master
fix rapidjson::value::Get<std::string>() may returns wrong data
This commit is contained in:
commit
369de87e5d
@ -480,7 +480,7 @@ template<typename ValueType>
|
||||
struct TypeHelper<ValueType, std::basic_string<typename ValueType::Ch> > {
|
||||
typedef std::basic_string<typename ValueType::Ch> StringType;
|
||||
static bool Is(const ValueType& v) { return v.IsString(); }
|
||||
static StringType Get(const ValueType& v) { return v.GetString(); }
|
||||
static StringType Get(const ValueType& v) { return StringType(v.GetString(), v.GetStringLength()); }
|
||||
static ValueType& Set(ValueType& v, const StringType& data, typename ValueType::AllocatorType& a) { return v.SetString(data, a); }
|
||||
};
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user