From 954bf1f656e610474d9a582774690dc505fb821b Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Fri, 14 Feb 2020 17:02:18 +0200 Subject: libcamera: controls: Move Control constructor to controls.h To avoid defining all specializations of the Control constructor manually, move the definition of those functions to controls.h and turn them into a single template function. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- include/libcamera/controls.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include/libcamera/controls.h') diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h index dfe69916..6f0ebf4f 100644 --- a/include/libcamera/controls.h +++ b/include/libcamera/controls.h @@ -146,7 +146,10 @@ class Control : public ControlId public: using type = T; - Control(unsigned int id, const char *name); + Control(unsigned int id, const char *name) + : ControlId(id, name, details::control_type>::value) + { + } private: Control(const Control &) = delete; -- cgit v1.2.1