From 1f5587b3ea23d03364107f39b24ff16545d04dd7 Mon Sep 17 00:00:00 2001 From: Bruno de Oliveira Abinader Date: Thu, 28 Apr 2016 18:24:24 +0300 Subject: [core] Added mbgl::underlying_type --- include/mbgl/util/traits.hpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 include/mbgl/util/traits.hpp (limited to 'include/mbgl/util/traits.hpp') diff --git a/include/mbgl/util/traits.hpp b/include/mbgl/util/traits.hpp new file mode 100644 index 0000000000..812d9fb547 --- /dev/null +++ b/include/mbgl/util/traits.hpp @@ -0,0 +1,15 @@ +#ifndef MBGL_UTIL_TRAITS +#define MBGL_UTIL_TRAITS + +#include + +namespace mbgl { + +template +constexpr auto underlying_type(T t) -> typename std::underlying_type::type { + return static_cast::type>(t); +} + +} // namespace mbgl + +#endif // MBGL_UTIL_TRAITS -- cgit v1.2.1