summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/libcamera/controls.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h
index 665bcac1..192be784 100644
--- a/include/libcamera/controls.h
+++ b/include/libcamera/controls.h
@@ -8,6 +8,7 @@
#pragma once
#include <assert.h>
+#include <optional>
#include <set>
#include <stdint.h>
#include <string>
@@ -373,11 +374,11 @@ public:
bool contains(unsigned int id) const;
template<typename T>
- T get(const Control<T> &ctrl) const
+ std::optional<T> get(const Control<T> &ctrl) const
{
const ControlValue *val = find(ctrl.id());
if (!val)
- return T{};
+ return std::nullopt;
return val->get<T>();
}