/* * This file is part of the DXX-Rebirth project . * It is copyright by its individual contributors, as recorded in the * project's Git history. See COPYING.txt at the top level for license * terms and a link to the Git history. */ #pragma once #include /* Convenience function to use std::underlying_type on a given value, * and always pick the right T for the enum being converted. */ template ::value, typename std::underlying_type::type>::type> static constexpr R underlying_value(const T e) { return static_cast(e); } template typename std::enable_if::value, T>::type underlying_value(T) = delete;