/workspaces/astro/sol3-sdk/cpp/sol3/cpp/enum.h Source File

Space-ng SDK: /workspaces/astro/sol3-sdk/cpp/sol3/cpp/enum.h Source File
Space-ng SDK
enum.h
Go to the documentation of this file.
1 
2 // Copyright (c) Space-ng, inc. All rights reserved.
3 
4 #pragma once
5 
6 #include <type_traits>
7 
8 namespace sol3::cpp {
9 
10 // Extract the underlying value type from an enumeration
11 template <typename T>
12 auto constexpr toUnderlying(T value) {
13  return static_cast<typename std::underlying_type<T>::type>(value);
14 }
15 
16 } // namespace sol3::cpp
Definition: enum.h:8
constexpr auto toUnderlying(T value)
Definition: enum.h:12