warning: implicitly-declared ‘constexpr QJsonValueRef::QJsonValueRef(const QJsonValueRef&)’ is deprecated
Unsolved
General and Desktop
-
The following code generates the a warning message.
#include <QJsonObject> QJsonValueRef operator << (QJsonValueRef ref, int) { return ref; } int main() { QJsonObject jo; jo["foo"] << 1; }
warning: implicitly-declared ‘constexpr QJsonValueRef::QJsonValueRef(const QJsonValueRef&)’ is deprecated
$ qmake --version
QMake version 3.1
Using Qt version 5.14.2 in /opt/Qt/5.14.2/gcc_64/libThank you in advance.
-
Don't copy the QJsonValue, pass it by reference. Also I don't understand what the operator in your example should do at all.
-
Don't copy the QJsonValue, pass it by reference. Also I don't understand what the operator in your example should do at all.
It's a code which just shows a warning message that copy constructor does not exist in QJsonValueRef class, and QJsonValueRef is a reference class of QJsonValue.
-
It's a code which just shows a warning message that copy constructor does not exist in QJsonValueRef class, and QJsonValueRef is a reference class of QJsonValue.