Remove the Q_TYPENAME define.

It is mostly not used (most places in Qt use typename directly), so
is already not very useful.

For example typename is used in:

QDataStream& operator<<(QDataStream& s, const QVector<T>& v)

Change-Id: I85337ad7d8d4ebbb424bfa2ab9a356456ff3e90f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
This commit is contained in:
Stephen Kelly 2012-01-06 07:33:17 +01:00 committed by Qt by Nokia
parent 7e40ea4499
commit 7aeccb183a
8 changed files with 14 additions and 20 deletions

View File

@ -552,7 +552,6 @@ namespace QT_NAMESPACE {}
# define Q_NO_BOOL_TYPE
# define Q_NO_EXPLICIT_KEYWORD
# define Q_NO_USING_KEYWORD
# define Q_TYPENAME
# define Q_OUTOFLINE_TEMPLATE inline
# define Q_BROKEN_TEMPLATE_SPECIALIZATION
# define Q_CANNOT_DELETE_CONSTANT
@ -586,7 +585,6 @@ namespace QT_NAMESPACE {}
/* Apply to all versions prior to Compaq C++ V6.0-000 - observed on
DEC C++ V5.5-004. */
# if __DECCXX_VER < 60060000
# define Q_TYPENAME
# define Q_BROKEN_TEMPLATE_SPECIALIZATION
# define Q_CANNOT_DELETE_CONSTANT
# endif
@ -1619,10 +1617,6 @@ inline int qMacVersion() { return QSysInfo::MacintoshVersion; }
# define Q_INLINE_TEMPLATE inline
#endif
#ifndef Q_TYPENAME
# define Q_TYPENAME typename
#endif
/*
Avoid "unused parameter" warnings
*/

View File

@ -159,7 +159,7 @@ inline QDebug operator<<(QDebug debug, const QList<T> &list)
#endif
{
debug.nospace() << '(';
for (Q_TYPENAME QList<T>::size_type i = 0; i < list.count(); ++i) {
for (typename QList<T>::size_type i = 0; i < list.count(); ++i) {
if (i)
debug << ", ";
debug << list.at(i);

View File

@ -591,7 +591,7 @@ void QVector<T>::append(const T &t)
}
template <typename T>
Q_TYPENAME QVector<T>::iterator QVector<T>::insert(iterator before, size_type n, const T &t)
typename QVector<T>::iterator QVector<T>::insert(iterator before, size_type n, const T &t)
{
int offset = int(before - p->array);
if (n != 0) {
@ -625,7 +625,7 @@ Q_TYPENAME QVector<T>::iterator QVector<T>::insert(iterator before, size_type n,
}
template <typename T>
Q_TYPENAME QVector<T>::iterator QVector<T>::erase(iterator abegin, iterator aend)
typename QVector<T>::iterator QVector<T>::erase(iterator abegin, iterator aend)
{
int f = int(abegin - p->array);
int l = int(aend - p->array);

View File

@ -285,11 +285,11 @@ void QTest::setBenchmarkResult(qreal result, QTest::QBenchmarkMetric metric)
}
template <typename T>
Q_TYPENAME T::value_type qAverage(const T &container)
typename T::value_type qAverage(const T &container)
{
Q_TYPENAME T::const_iterator it = container.constBegin();
Q_TYPENAME T::const_iterator end = container.constEnd();
Q_TYPENAME T::value_type acc = Q_TYPENAME T::value_type();
typename T::const_iterator it = container.constBegin();
typename T::const_iterator end = container.constEnd();
typename T::value_type acc = typename T::value_type();
int count = 0;
while (it != end) {
acc += *it;

View File

@ -121,8 +121,8 @@ public:
private:
const Graph *g;
Q_TYPENAME QHash<Vertex *, QHash<Vertex *, EdgeData *> * >::const_iterator row;
Q_TYPENAME QHash<Vertex *, EdgeData *>::const_iterator column;
typename QHash<Vertex *, QHash<Vertex *, EdgeData *> * >::const_iterator row;
typename QHash<Vertex *, EdgeData *>::const_iterator column;
};
const_iterator constBegin() const {
@ -228,7 +228,7 @@ public:
QString edges;
QSet<Vertex *> setOfVertices = vertices();
for (Q_TYPENAME QSet<Vertex*>::const_iterator it = setOfVertices.begin(); it != setOfVertices.end(); ++it) {
for (typename QSet<Vertex*>::const_iterator it = setOfVertices.begin(); it != setOfVertices.end(); ++it) {
Vertex *v = *it;
QList<Vertex*> adjacents = adjacentVertices(v);
for (int i = 0; i < adjacents.count(); ++i) {

View File

@ -93,7 +93,7 @@ void FixedColumnMatrix<T, NumColumns>::addRow(const T &value)
template <class T, int NumColumns>
void FixedColumnMatrix<T, NumColumns>::insertRow(int r, const T &value)
{
Q_TYPENAME Storage::iterator it = m_storage.begin();
typename Storage::iterator it = m_storage.begin();
it += r * NumColumns;
m_storage.insert(it, NumColumns, value);
}

View File

@ -174,7 +174,7 @@ bool isSorted(ContainerType &container, LessThan lessThan)
template <typename ContainerType>
bool isSorted(ContainerType &container)
{
return isSorted(container, qLess<Q_TYPENAME ContainerType::value_type>());
return isSorted(container, qLess<typename ContainerType::value_type>());
}

View File

@ -528,7 +528,7 @@ void QRawVector<T>::append(const T &t)
}
template <typename T>
Q_TYPENAME QRawVector<T>::iterator QRawVector<T>::insert(iterator before, size_type n, const T &t)
typename QRawVector<T>::iterator QRawVector<T>::insert(iterator before, size_type n, const T &t)
{
int offset = int(before - m_begin);
if (n != 0) {
@ -562,7 +562,7 @@ Q_TYPENAME QRawVector<T>::iterator QRawVector<T>::insert(iterator before, size_t
}
template <typename T>
Q_TYPENAME QRawVector<T>::iterator QRawVector<T>::erase(iterator abegin, iterator aend)
typename QRawVector<T>::iterator QRawVector<T>::erase(iterator abegin, iterator aend)
{
int f = int(abegin - m_begin);
int l = int(aend - m_begin);