memgraph/include/utils/underlying_cast.hpp

9 lines
201 B
C++
Raw Normal View History

#pragma once
2015-10-14 02:17:45 +08:00
#include <type_traits>
template <typename T>
constexpr typename std::underlying_type<T>::type underlying_cast(T e) {
return static_cast<typename std::underlying_type<T>::type>(e);
}