template typename enum as default value
-
use QVariant::Invalid as template default value
template <typename T, typename V = QVariant::Invalid> T *registerExServiceStp2(const ServiceType &type, void (T::*func)(const V &) = nullptr) { Service *service = typeToService(type); if (!service) return nullptr; if (!service->token()) { T *token = new T(service); if (func) (token->*func)(service->extraInfo().value<V>()); service->token(token); emit moduleStatusChanged(type); } return dynamic_cast<T *>(service->token()); }but get this
error: ‘Invalid’ in ‘class QVariant’ does not name a type line: template <typename T, typename V = typename QVariant::Invalid>how should i fix it
-
Hi
Maybetemplate <typename T, typename V = QVariant() > ....if the intent was to have V be an invalid QVariant pr default if not specified.
-
Hi
Maybetemplate <typename T, typename V = QVariant() > ....if the intent was to have V be an invalid QVariant pr default if not specified.