summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools/collections
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2013-12-09 22:13:10 -0800
committerLars Knoll <lars.knoll@qt.io>2019-12-08 18:20:31 +0100
commit7cc977759b84204427c1667e5b21ac75c3f7f5ab (patch)
tree7d68538c1d857621e8bf93c9980d1cc749177873 /tests/auto/corelib/tools/collections
parentdb89349bdba2fcc03b2f7e2d23f549a9ec5dc0e3 (diff)
Use <type_traits> to properly have QVector<T>::parameter_type
That allows us to pass by value for all fundamental and pointer types. This requires some magic to remove methods taking a T&& to avoid ambiguous overloads for QVector<int/qsizetype>. Remove them for all cases where parameter_type is T, as copying or moving will do exactly the same thing for those types. Change-Id: I8133fecd3ac29bb8f6ae57376e680bc3d616afbf Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto/corelib/tools/collections')
-rw-r--r--tests/auto/corelib/tools/collections/tst_collections.cpp24
1 files changed, 1 insertions, 23 deletions
diff --git a/tests/auto/corelib/tools/collections/tst_collections.cpp b/tests/auto/corelib/tools/collections/tst_collections.cpp
index 5ba8545b61..023b22b4ba 100644
--- a/tests/auto/corelib/tools/collections/tst_collections.cpp
+++ b/tests/auto/corelib/tools/collections/tst_collections.cpp
@@ -3583,30 +3583,8 @@ template<class Container> void insert_remove_loop_impl()
}
-//Add insert(int, int, T) so it has the same interface as QVector and QVarLengthArray for the test.
template<typename T>
-struct ExtList : QList<T> {
- using QList<T>::insert;
- void insert(int before, int n, const T&x) {
- while (n--) {
- this->insert(before, x );
- }
- }
- void insert(typename QList<T>::iterator before, int n, const T&x) {
- while (n--) {
- before = this->insert(before, x);
- }
- }
-
- void remove(int i) {
- this->removeAt(i);
- }
- void remove(int i, int n) {
- while (n--) {
- this->removeAt(i);
- }
- }
-};
+using ExtList = QList<T>;
void tst_Collections::insert_remove_loop()
{