mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-25 03:12:56 +00:00
make use of Q_TYPEOF() in compat Q_FOREACH()
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
7f5237aaed
commit
61e0a23d43
1 changed files with 3 additions and 3 deletions
|
@ -1199,7 +1199,7 @@ typedef uint Flags;
|
|||
|
||||
#endif /* Q_NO_TYPESAFE_FLAGS */
|
||||
|
||||
#if (defined(Q_CC_GNU) || defined(Q_CC_CLANG)) && defined(QT_FOREACH_COMPAT)
|
||||
#ifdef QT_FOREACH_COMPAT
|
||||
template <typename T>
|
||||
class QForeachContainer {
|
||||
public:
|
||||
|
@ -1211,13 +1211,13 @@ private:
|
|||
};
|
||||
|
||||
#define Q_FOREACH(variable, container) \
|
||||
for (variable: QForeachContainer<__typeof__(container)>(container))
|
||||
for (variable: QForeachContainer<Q_TYPEOF(container)>(container))
|
||||
|
||||
#else
|
||||
|
||||
#define Q_FOREACH(variable, container) for (variable: container)
|
||||
|
||||
#endif
|
||||
#endif // QT_FOREACH_COMPAT
|
||||
|
||||
#define Q_FOREVER for(;;)
|
||||
#ifndef QT_NO_KEYWORDS
|
||||
|
|
Loading…
Add table
Reference in a new issue