Skip to content

Conversation

@PhoenixChen98
Copy link

support assign json such as:
json["key"] = jsonObject;

@Barenboim
Copy link
Contributor

看不太懂这个是支持的什么功能。我们之前不支持json["key"] = another_json 这样的写法么?

@PhoenixChen98
Copy link
Author

是的,之前不支持

@Barenboim
Copy link
Contributor

Barenboim commented Jun 1, 2025 via email

@PhoenixChen98
Copy link
Author

我是调用的已有方法,里面是copy的,应该没内存泄露风险

}
if (parent_ != nullptr)
{
assign(other);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里不用std::move() ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

哦对,我改下

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

然后也没有右值的assign接口好像。

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

其实update_arr和push_back等一系列方法也都没有右值接口,我这里加上move意义也不大了

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

但是这样语义上有点不对了。感觉是可以实现的,我想想。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants