forked from qt-creator/qt-creator
Reinvent deprecated qSort as Utils::sort
Change-Id: I4f6011cc2b6127037249aabc2426a88ad7108ebf Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Daniel Teske <daniel.teske@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -113,6 +113,18 @@ auto transform(const QList<T> &container, F function) -> QList<decltype(function
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename Container>
|
||||
inline void sort(Container &c)
|
||||
{
|
||||
std::sort(c.begin(), c.end());
|
||||
}
|
||||
|
||||
template <typename Container, typename Predicate>
|
||||
inline void sort(Container &c, Predicate p)
|
||||
{
|
||||
std::sort(c.begin(), c.end(), p);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif // ALGORITHM_H
|
||||
|
||||
Reference in New Issue
Block a user