diff --git a/src/global.h b/src/global.h index 1161602..865d599 100644 --- a/src/global.h +++ b/src/global.h @@ -544,6 +544,8 @@ template ObjectMap dumpDBusObject(const QHash> &map) { static_assert(std::is_base_of_v, "dumpDBusObject only support which derived by QObject class"); + static_assert(std::is_same_v || std::is_same_v, + "dumpDBusObject only support QString/QDBusObject as key type"); ObjectMap objs; for (const auto &[key, value] : map.asKeyValueRange()) { @@ -552,8 +554,6 @@ ObjectMap dumpDBusObject(const QHash> &map) objs.insert(QDBusObjectPath{getObjectPathFromAppId(key)}, interAndProps); } else if constexpr (std::is_same_v) { objs.insert(key, interAndProps); - } else { - static_assert(false, "dumpDBusObject only support QString/QDBusObject as key type"); } }