mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-23 10:22:55 +00:00
drop foreach() compat
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
2b29e03a1c
commit
923648946b
2 changed files with 1 additions and 19 deletions
|
@ -136,7 +136,7 @@ if(NOT KATIE_FOUND)
|
|||
find_package(X11 REQUIRED)
|
||||
endif()
|
||||
|
||||
set(compat_definitions -DQT_NAMESPACE_COMPAT -DQT_FOREACH_COMPAT)
|
||||
set(compat_definitions -DQT_NAMESPACE_COMPAT)
|
||||
set(KATIE_DEFINITIONS ${KATIE_DEFINITIONS} ${compat_definitions})
|
||||
set(QT_DEFINITIONS ${KATIE_DEFINITIONS})
|
||||
set(QT4_DEFINITIONS ${KATIE_DEFINITIONS})
|
||||
|
|
|
@ -626,26 +626,8 @@ typedef uint Flags;
|
|||
|
||||
#endif /* Q_NO_TYPESAFE_FLAGS */
|
||||
|
||||
#ifdef QT_FOREACH_COMPAT
|
||||
template <typename T>
|
||||
class QForeachContainer {
|
||||
public:
|
||||
inline QForeachContainer(const T& t) : c(t) { }
|
||||
inline typename T::const_iterator begin() { return c.begin(); }
|
||||
inline typename T::const_iterator end() { return c.end(); }
|
||||
private:
|
||||
const T c;
|
||||
};
|
||||
|
||||
#define Q_FOREACH(variable, container) \
|
||||
for (variable: QForeachContainer<Q_TYPEOF(container)>(container))
|
||||
|
||||
#else // QT_FOREACH_COMPAT
|
||||
|
||||
#define Q_FOREACH(variable, container) for (variable: container)
|
||||
|
||||
#endif // QT_FOREACH_COMPAT
|
||||
|
||||
#define Q_FOREVER for(;;)
|
||||
#ifndef QT_NO_KEYWORDS
|
||||
# ifndef foreach
|
||||
|
|
Loading…
Add table
Reference in a new issue