While reading "c++ gui programming eith Qt 4 , second edition " I came across this topic : "The STL header provides a more complete set of generic algorithms. these algorithms can be used on Qt containers as well as STL containers. If STL implementations are available on all your platforms, there is probably no reason to avoid using the STL algorithms when Qt lacks an equivalent algorithm ."
It states that the generic algorithms of STL(which is defined in "algorithm" header) can be used with Qt containers as well . But when I run the following code it shows an error that "sort: identifier not found" :
#include <QApplication>
#include <algorithm>
#include <QVector>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QVector<int>vec{9,6,10,5,7};
sort(vec.begin(),vec.end());
return a.exec();
}
Is there any way to fix it without using Qt Algorithms?