summaryrefslogtreecommitdiff
path: root/src/libcamera/pipeline/rpi/common/rpi_stream.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcamera/pipeline/rpi/common/rpi_stream.h')
-rw-r--r--src/libcamera/pipeline/rpi/common/rpi_stream.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/libcamera/pipeline/rpi/common/rpi_stream.h b/src/libcamera/pipeline/rpi/common/rpi_stream.h
index fc2bdfe2..48ed41ab 100644
--- a/src/libcamera/pipeline/rpi/common/rpi_stream.h
+++ b/src/libcamera/pipeline/rpi/common/rpi_stream.h
@@ -14,6 +14,7 @@
#include <vector>
#include <libcamera/base/flags.h>
+#include <libcamera/base/utils.h>
#include <libcamera/stream.h>
@@ -180,19 +181,14 @@ private:
template<typename E, std::size_t N>
class Device : public std::array<class Stream, N>
{
-private:
- constexpr auto index(E e) const noexcept
- {
- return static_cast<std::underlying_type_t<E>>(e);
- }
public:
Stream &operator[](E e)
{
- return std::array<class Stream, N>::operator[](index(e));
+ return std::array<class Stream, N>::operator[](utils::to_underlying(e));
}
const Stream &operator[](E e) const
{
- return std::array<class Stream, N>::operator[](index(e));
+ return std::array<class Stream, N>::operator[](utils::to_underlying(e));
}
};