Problem with operator <<
Solved
General and Desktop
-
Hi all,
I'm defining a simple custom class and I'd like to define a << operator to have a suitable debug output.
The class is defined as:class Prenotazione : public QObject { Q_OBJECT public: int _id; int _value; QDebug operator<<( QDebug dbg, const Prenotazione &myObject){ dbg << "QQQ"; return dbg; };
The compiler says that 'error C2804: 'operator <<' (binary) has too many parameters'.
I saw many examples and they are written in this way .. in don't understand why I have this error ..
Thanks!