QCollator: enable move semantics

This necessitates adding d==0 checks in QCollator. By documenting that
moved-from instances can only be assigned to or destroyed, we can
limit the functions in which to check for d==0 to the assignment
operator and the destructor.

Doing otherwise would destroy all advantages of move semantics by
introducing a heap allocation to re-populate other.d.

Add a test for this (QCollator didn't have any before).

Change-Id: Ic6ff202072822bebfd5e48259c3d0fa345a63118
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QCollator(SortKey): declare as shared

This enables specialisations of (std and q) swap using member-swap
and declares the types movable for efficient use in Qt containers,
and QList in particular.

This is a binary-incompatible change, so cannot wait for 5.2.1.

Change-Id: I7e90b6397ac4d00d0a7a5c42bae166c1b43e1994
Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QCollatorSortKey: inline operator<

This code was duplicated in every qcollator_platform.cpp and identical everywhere,
except in _icu, which uses a QByteArray m_key and the implementation used
QByteArray::operator<, which is semantically and probably code-wise identical to
what the other implementations did (after inlining).

Inlining this function removes a potential maintenance problem and increases
speed without violating encapsulation.

Change-Id: If3e9d38a7d4326b49f0611a9f4187c53960e8a03
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
tst_QAlgorithms: fix compilation with C++11 enabled

GCC refuses to use a merely static const uint array in a constexpr function.

Fix by making the array constexpr if supported by the compiler.

Change-Id: Idd59d3f74f8f4e98aad82bc892f4a6469932df9f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>