diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/libcamera/base/utils.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/libcamera/base/utils.h b/include/libcamera/base/utils.h index 37d9af60..922e4dfa 100644 --- a/include/libcamera/base/utils.h +++ b/include/libcamera/base/utils.h @@ -369,6 +369,12 @@ decltype(auto) abs_diff(const T &a, const T &b) double strtod(const char *__restrict nptr, char **__restrict endptr); +template<class Enum> +constexpr std::underlying_type_t<Enum> to_underlying(Enum e) noexcept +{ + return static_cast<std::underlying_type_t<Enum>>(e); +} + } /* namespace utils */ #ifndef __DOXYGEN__ |