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 <simon.hausmann@qt.io>
bb10
Thiago Macieira 2012-06-13 13:58:53 +02:00 committed by Lars Knoll
parent 812a611dc0
commit 8f3189f7a2
1 changed files with 6 additions and 2 deletions

View File

@ -58,6 +58,8 @@ template <class T>
struct QPodArrayOps
: QTypedArrayData<T>
{
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 <class T>
struct QGenericArrayOps
: QTypedArrayData<T>
{
typedef const T &parameter_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());