memgraph/utils/underlying_cast.hpp

13 lines
283 B
C++
Raw Normal View History

2015-10-14 02:17:45 +08:00
#ifndef MEMGRAPH_UTILS_UNDERLYING_CAST_HPP
#define MEMGRAPH_UTILS_UNDERLYING_CAST_HPP
#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);
}
#endif