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
parent
812a611dc0
commit
8f3189f7a2
|
|
@ -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 ¶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());
|
||||
|
|
|
|||
Loading…
Reference in New Issue