summaryrefslogtreecommitdiff
path: root/src/libcamera/controls.cpp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-02-14 16:49:31 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-03-06 18:10:19 +0200
commitcd04b9a96c7643f92f6b555b594739e0ddf0406a (patch)
tree9f823d10d07dec8698d68d5e84df47a22ffc00e8 /src/libcamera/controls.cpp
parent9c6d32fcf3198cc83cff6af3c9393e94c88bf9b9 (diff)
libcamera: controls: Decouple control and value type in ControlList::set()
The ControlList::set() method takes a reference to a Control<T>, and requires the value to be a reference to T. This prevents the set() method from being used with value types that are convertible to T, and in particular with std::array or std::vector value types when the Control type is a Span<> to support array controls. Fix this by decoupling the control type and value type in the template parameters. The compiler will still catch invalid conversions, including cases where the constructor of type T from the value type is explicit. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/libcamera/controls.cpp')
-rw-r--r--src/libcamera/controls.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp
index f632d60a..a136ebd2 100644
--- a/src/libcamera/controls.cpp
+++ b/src/libcamera/controls.cpp
@@ -735,7 +735,7 @@ bool ControlList::contains(unsigned int id) const
*/
/**
- * \fn template<typename T> void ControlList::set(const Control<T> &ctrl, const T &value)
+ * \fn template<typename T, typename V> void ControlList::set(const Control<T> &ctrl, const V &value)
* \brief Set the control \a ctrl value to \a value
* \param[in] ctrl The control
* \param[in] value The control value