[PATCH 0/2] libcamera: Add utils::to_underlying() helper

Laurent Pinchart laurent.pinchart at ideasonboard.com
Sun Feb 25 17:43:45 CET 2024


Hello,

C++23 has a std::to_underlying() helper that casts an enumeration to its
underlying type. libcamera open-codes this in multiple places. This
series adds an identical helper to the utils:: namespace, and uses it to
replace the open-coded implementations.

Laurent Pinchart (2):
  libcamera: utils: Add to_underlying() helper function
  libcamera: Use utils::to_underlying()

 include/libcamera/base/utils.h                 |  6 ++++++
 src/ipa/rpi/controller/rpi/sdn.cpp             |  3 ++-
 src/libcamera/base/utils.cpp                   | 10 ++++++++++
 src/libcamera/pipeline/rpi/common/rpi_stream.h | 10 +++-------
 src/libcamera/stream.cpp                       |  2 +-
 5 files changed, 22 insertions(+), 9 deletions(-)


base-commit: 059bbcdc34e7d887ee02fdd47613bd6e0eb70d16
-- 
Regards,

Laurent Pinchart



More information about the libcamera-devel mailing list