#include #ifndef UTIL_HPP #define UTIL_HPP 1 #include #include #if UNICODE == 1 using screenchr = wchar_t; #else using screenchr = char; #endif /*Shamelessly stolen from stackoverflow * https://stackoverflow.com/questions/52303316/get-index-by-type-in-stdvariant * by Barry*/ template struct tag { }; template struct get_index; template struct get_index> : std::integral_constant...>(tag()).index()> { }; template struct is_variant : std::false_type {}; template struct is_variant> : std::disjunction...> {}; template constexpr bool is_variant_v = is_variant::value; template struct cxpow { static constexpr T value = (T)base * cxpow::value; }; template struct cxpow { static constexpr T value = 1; }; template constexpr T cxpow_v = cxpow::value; template struct cxrt { static constexpr T value = (T)base / cxpow::value; }; template constexpr T cxrt_v = cxrt::value; #endif