Skip to content

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

@JTrantow

Description

@JTrantow
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions