From cd04b9a96c7643f92f6b555b594739e0ddf0406a Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Fri, 14 Feb 2020 16:49:31 +0200 Subject: libcamera: controls: Decouple control and value type in ControlList::set() The ControlList::set() method takes a reference to a Control, 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 Reviewed-by: Kieran Bingham --- src/libcamera/controls.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libcamera/controls.cpp') 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 void ControlList::set(const Control &ctrl, const T &value) + * \fn template void ControlList::set(const Control &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 -- cgit v1.2.1