default argument compiler warning
quick question:
I've got a func
private:
int send(const QString command, QString& response = QString());
my compiler says:
non-standard: default argument: converting from class QString in calss QString&
inside the func I have
if (response.isNull())
return 0;
to check for the default argument.
what's wrong, and how should I define the default argument? is at all it important?
thanks...
K
Re: default argument compiler warning
Try this:
Code:
int send(const QString& command, const QString& response="" );
The problem in your code is that the second paramter is a reference but not const, and you can't have temp initialization on non const reference.
Note that I changed both to const reference, its more efficient that way.