Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C26478: Don't use std::move on constant variables. #5746

Closed
JTrantow opened this issue Jan 29, 2020 · 1 comment
Closed

C26478: Don't use std::move on constant variables. #5746

JTrantow opened this issue Jan 29, 2020 · 1 comment

Comments

@JTrantow
Copy link
Contributor

Required Info
Camera Model { R200 / F200 / SR300 / ZR300 / D400 }
Firmware Version NA
Operating System & Version {Win10 in use}
Platform PC
SDK Version 2.32. master }
Language {C/C++}
Segment {all}

Issue Description

sensor.cpp has four places where it uses std::move() on const data. The VS C++ Core guidelines spits out a C26478 warning on these lines. Not a problem but no harm/risk in cleaning this up.

https://docs.microsoft.com/en-us/visualstudio/code-quality/c26478?view=vs-2019

Warning C26478: Don't use std::move on constant variables. (es.56)

This warning is to indicate that the use of std::move not consistent with how std::move is intended to be used. When called on a const object, std::move returns a copy of the object, which is likely not the developer's intent.

@ev-mp
Copy link
Collaborator

ev-mp commented Feb 3, 2020

@JTrantow, the PR has been accepted.
Closing the issue accordingly.

Thanks again for the contribution!

@ev-mp ev-mp closed this as completed Feb 3, 2020
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

No branches or pull requests

2 participants