示例#1
0
文件: Value.cpp 项目: pedia/raidget
Value& Value::operator=(const Value& v) {
	if(this == &v) return *this;
	FreeRef();
	data = v.data;
	if(IsRef())
		ptr()->Retain();
	return *this;
}
示例#2
0
Value& Value::operator=(const Value& v) {
	if(this == &v) return *this;
	Value h = v; // Make copy a 'v' can be reference to ValueMap/Array contained element
	FreeRef();   // e.g. json = json["foo"]
	data = h.data;
	if(IsRef())
		ptr()->Retain();
	return *this;
}