Skip to content

Conversation

bavulapati
Copy link
Contributor

No description provided.

@@ -800,6 +800,7 @@ auto JSON::assign(const JSON::String &key, const JSON &value) -> void {
this->data_object.emplace(key, value);
}

// NOLINTNEXTLINE(cppcoreguidelines-rvalue-reference-param-not-moved)
auto JSON::assign(const JSON::String &key, JSON &&value) -> void {
assert(this->is_object());
this->data_object.emplace(key, value);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
this->data_object.emplace(key, value);
this->data_object.emplace(key, std::move(value));

Maybe what it wants is this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, but that would conflict with another rule saying that move is ineffective

error: passing result of std::move() as a const reference argument; no move will actually happen [performance-move-const-arg,-warnings-as-errors]
  805 |   this->data_object.emplace(key, std::move(value));
      |                                  ^~~~~~~~~~     ~

Copy link
Member

Choose a reason for hiding this comment

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

Ah, OK

std::back_inserter(this->data));
return;
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this return is needed

@bavulapati
Copy link
Contributor Author

@jviotti PTAL

@jviotti
Copy link
Member

jviotti commented Jul 28, 2025

Looks good, but there are conflicts again

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.

2 participants