From 8f3189f7a266abf29f241551f72f24027de18287 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 13 Jun 2012 13:58:53 +0200 Subject: [PATCH] Add the QArrayDataOps::parameter_type typedef It's a typedef meant to replace the "const T &" parameters (hence the name). But it's actually just a T for POD types, so we don't create references to them. Change-Id: I10c746d5e852c957ec84319712597478c4dc872c Reviewed-by: Simon Hausmann --- src/corelib/tools/qarraydataops.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/corelib/tools/qarraydataops.h b/src/corelib/tools/qarraydataops.h index 11494a5f6f..5b59221f10 100644 --- a/src/corelib/tools/qarraydataops.h +++ b/src/corelib/tools/qarraydataops.h @@ -58,6 +58,8 @@ template struct QPodArrayOps : QTypedArrayData { + typedef T parameter_type; + void appendInitialize(size_t newSize) { Q_ASSERT(this->isMutable()); @@ -81,7 +83,7 @@ struct QPodArrayOps this->size += e - b; } - void copyAppend(size_t n, const T &t) + void copyAppend(size_t n, parameter_type t) { Q_ASSERT(this->isMutable()); Q_ASSERT(!this->isShared()); @@ -145,6 +147,8 @@ template struct QGenericArrayOps : QTypedArrayData { + typedef const T ¶meter_type; + void appendInitialize(size_t newSize) { Q_ASSERT(this->isMutable()); @@ -172,7 +176,7 @@ struct QGenericArrayOps } } - void copyAppend(size_t n, const T &t) + void copyAppend(size_t n, parameter_type t) { Q_ASSERT(this->isMutable()); Q_ASSERT(!this->isShared());