diff options
| author | Liang Qi <liang.qi@theqtcompany.com> | 2015-10-14 20:06:10 +0200 |
|---|---|---|
| committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-10-14 20:06:10 +0200 |
| commit | d570274da3ba262d85cf9a32de34678c85c1af9e (patch) | |
| tree | 8e67de1cc937e835d3507a38a415ac4aa579608b /src/xmlpatterns/expr/qorderby.cpp | |
| parent | 14afeb8512bb4c4614256ebd227c06df2a1c8103 (diff) | |
| parent | 688b29fc5aeab0eafbb457a0fa6953856eeac928 (diff) | |
| download | qtxmlpatterns-d570274da3ba262d85cf9a32de34678c85c1af9e.tar.gz | |
Merge remote-tracking branch 'origin/5.6' into dev
Conflicts:
tests/auto/xmlpatterns/tst_xmlpatterns.cpp
Change-Id: Ib93b62f45d796dd3ed2d5d03f602699295f62705
Diffstat (limited to 'src/xmlpatterns/expr/qorderby.cpp')
| -rw-r--r-- | src/xmlpatterns/expr/qorderby.cpp | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/xmlpatterns/expr/qorderby.cpp b/src/xmlpatterns/expr/qorderby.cpp index ba6bcb2..7dbf320 100644 --- a/src/xmlpatterns/expr/qorderby.cpp +++ b/src/xmlpatterns/expr/qorderby.cpp @@ -44,6 +44,7 @@ #include "qorderby_p.h" #include <algorithm> +#include <functional> QT_BEGIN_NAMESPACE @@ -72,11 +73,17 @@ void OrderBy::OrderSpec::prepare(const Expression::Ptr &source, * @short Functor used by Qt's qSort() and qStableSort(). Used for FLWOR's * <tt>order by</tt> expression. * - * This must be in the global namespace, since it is specializing qLess(), which - * is in the global namespace. Hence it can't be in QPatternist. + * This must be in the std namespace, since it is specializing std::less(), which + * is in the std namespace. Hence it can't be in QPatternist. */ + +QT_END_NAMESPACE + +QT_USE_NAMESPACE + +namespace std { template<> -class qLess<Item::List> +struct less<Item::List> { private: @@ -87,9 +94,9 @@ private: } public: - inline qLess(const OrderBy::OrderSpec::Vector &orderspecs, - const DynamicContext::Ptr &context) : m_orderSpecs(orderspecs) - , m_context(context) + inline less(const OrderBy::OrderSpec::Vector &orderspecs, + const DynamicContext::Ptr &context) : m_orderSpecs(orderspecs) + , m_context(context) { Q_ASSERT(!m_orderSpecs.isEmpty()); Q_ASSERT(context); @@ -158,6 +165,9 @@ private: const OrderBy::OrderSpec::Vector & m_orderSpecs; const DynamicContext::Ptr & m_context; }; +} // namespace std + +QT_BEGIN_NAMESPACE Item::Iterator::Ptr OrderBy::mapToSequence(const Item &i, const DynamicContext::Ptr &) const @@ -169,7 +179,7 @@ Item::Iterator::Ptr OrderBy::evaluateSequence(const DynamicContext::Ptr &context { Item::List tuples(m_operand->evaluateSequence(context)->toList()); - const qLess<Item::List> sorter(m_orderSpecs, context); + const std::less<Item::List> sorter(m_orderSpecs, context); Q_ASSERT(m_stability == StableOrder || m_stability == UnstableOrder); |
