+
Skip to content

Conversation

tmadlener
Copy link
Member

@tmadlener tmadlener commented Dec 19, 2024

The frame is move only in any case

BEGINRELEASENOTES

  • Remove an unnecessary r-value reference qualifier for sinking the metadata Frame into the MetadataSvc.

ENDRELEASENOTES

Mainly because I saw this lightning talk yesterday and this seems to be a case where it's unnecessary.

(We have this in quite a few places, where the move-only property of our types already ensures that a std::move on the calling site is necessary if not using a temporary)

The frame is move only in any case
@m-fila
Copy link
Member

m-fila commented Dec 19, 2024

Is the title wrong? The changes here are to rvalue references not to the universal references

@tmadlener tmadlener changed the title Remove the unnecessary universal reference Remove the unnecessary r-value reference Dec 19, 2024
@tmadlener
Copy link
Member Author

Yes, indeed. Title should be r-value not universal reference

Copy link
Member

@m-fila m-fila left a comment

Choose a reason for hiding this comment

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

Sounds very reasonable, points taken 😄
I couldn't find a clang-tidy check to flag such pattern

Core guidelines rules F.16 and F.18

@jmcarcell
Copy link
Member

Sounds very reasonable, points taken 😄 I couldn't find a clang-tidy check to flag such pattern

Core guidelines rules F.16 and F.18

I think it's only F.18 that applies here, and the key part is for why making this change is just simplicity:

Passing by value does generate one extra (cheap) move operation, but prefer simplicity and clarity first.

@jmcarcell jmcarcell merged commit 6340086 into main Dec 20, 2024
7 of 9 checks passed
@jmcarcell jmcarcell deleted the rm-unnecessary-universalref branch December 20, 2024 10:44
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

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载