In this call
isFlag( QString( *(myVar + 1)))
the argument is a temporary QString
. You cannot bind non-const references to temporaries, you you would need to change isFlag
to take a const reference:
bool myObject::isFlag( const QString &pArgument) const {
If you cannot use a const
reference, then you should create a QString
, then pass it to the function:
QString qs( *(myVar + 1));
isFlag(qs);
All of the above assumes that a QString
can be constructed from, *(myvar +1)
, which is, again, a temporary.