From 6d492c2d758f7ab958f9d4afe1b157b59bb41c34 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Thu, 24 Oct 2019 01:05:37 +0300 Subject: libcamera: controls: Add move constructor to ControlInfoMap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ControlInfoMap class has a move assignment operator from a plain map, but no corresponding move constructor. Add one. Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Reviewed-by: Niklas Söderlund Reviewed-by: Kieran Bingham --- src/libcamera/controls.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/libcamera/controls.cpp') diff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp index a6223b82..50f37c6b 100644 --- a/src/libcamera/controls.cpp +++ b/src/libcamera/controls.cpp @@ -446,6 +446,19 @@ ControlInfoMap::ControlInfoMap(std::initializer_list init) generateIdmap(); } +/** + * \brief Construct a ControlInfoMap from a plain map + * \param[in] info The control info plain map + * + * Construct a new ControlInfoMap and populate its contents with those of + * \a info using move semantics. Upon return the \a info map will be empty. + */ +ControlInfoMap::ControlInfoMap(Map &&info) + : Map(std::move(info)) +{ + generateIdmap(); +} + /** * \fn ControlInfoMap &ControlInfoMap::operator=(const ControlInfoMap &other) * \brief Copy assignment operator, replace the contents with a copy of \a other -- cgit v1.2.1