diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-01-25 19:15:22 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-02-04 21:00:38 +0200 |
commit | 515211e8efd1412c09ae0bd30b6382b27b85036f (patch) | |
tree | 8d83c8867b352beca60565ea5fbdfbde14e5571d /src/qcam/assets/feathericons/more-horizontal.svg | |
parent | 6dfa2040820d44584a1c5430f42dfc9b1ea56c9a (diff) |
libcamera: geometry: Mark const functions with __nodiscard
Geometry classes generally have two sets of functions, one that operates
on the object and modifies it (e.g. Rectangle::scaleBy()), and one that
performs the same operations by instead return a modified copy of the
object, leaving the original untouched (e.g.Rectangle::scaledBy()). As
the names are close, they can easily be mistaken, with the const version
used instead of the in-place version.
To catch these errors at compile time, mark the const versions with
__nodiscard, as there is no use case for calling them without using the
result of the call.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/qcam/assets/feathericons/more-horizontal.svg')
0 files changed, 0 insertions, 0 deletions