
Originally Posted by
anda_skoa
Do you want to change the lists in the method?
I.e. why not use const &?
Cheers,
_
I tried it, like this
QList<QString> fileProcess::unique_strs(QList<QString> const &old_data, QList<QString> const &new_data)
{
//awkward solution and maybe meaningless, hope that in the future this could be solved
return set_difference_lazy(const_cast<QList<QString>&>(new_data), const_cast<QList<QString>&>(old_data));
}
QList<QString> fileProcess::unique_strs(QList<QString> const &old_data, QList<QString> const &new_data)
{
//awkward solution and maybe meaningless, hope that in the future this could be solved
return set_difference_lazy(const_cast<QList<QString>&>(new_data), const_cast<QList<QString>&>(old_data));
}
To copy to clipboard, switch view to plain text mode
There are two problems
1 : this solution is awkward
2 : I don't know the c++ sites would accept the parameters as reference or just copy them anyway?
Bookmarks