I have a dynamic array.
int* array = new int[size]
I am using the Qt library to develop an application in C++11.
Can I use qSort from QtAlgorithms.h on it this way:
qSort(array, array+size-1)
I am not sure since the arguments require a type of RandomAccessIterator
Does that imply any pointer ?
qSort()has been deprecated since Qt 5.2. Quoting from the ChangeLog:Note that as the ChangeLog mentions, there are cases where a trivial find/replace is not sufficient.
For some discussion on the differences in speed of
std::sort()andqSort(), see here.These are just warnings now, but will likely be errors with Qt 6.