diff --git a/src/util/timer.h b/src/util/timer.h index 1a016d30d2e..3d7a85078d5 100644 --- a/src/util/timer.h +++ b/src/util/timer.h @@ -65,7 +65,7 @@ class ScopedTimer { template ScopedTimer(Stat::ComputeFlags compute, T&& key, Ts&&... args) : m_timer(std::nullopt) { - static_assert(char_type_size() == sizeof(QString::value_type), + static_assert(!std::is_same_v>, char*>, "string type likely not UTF-16, please pass QStringLiteral by " "means of u\"key text\"_s"); if (!CmdlineArgs::Instance().getDeveloper()) { @@ -96,19 +96,6 @@ class ScopedTimer { m_timer.reset(); } private: - // utility function - template - constexpr static std::size_t char_type_size() { - if constexpr (std::is_array_v) { - return sizeof(std::remove_all_extents_t); - } else if constexpr (std::is_pointer_v) { - // assume this is some point to char array then. - return sizeof(std::remove_pointer_t); - } else { - // assume this is some QString or std::string type - return sizeof(typename T::value_type); - } - } // nullopt also counts as cancelled std::optional m_timer; };