mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 12:09:14 +00:00
8254880: ZGC: Let ZList iterators be alias templates
Reviewed-by: ayang, kbarrett, tschatzl
This commit is contained in:
parent
011dd0d8fa
commit
98a395a39e
@ -111,26 +111,8 @@ public:
|
||||
bool next(T** elem);
|
||||
};
|
||||
|
||||
// Iterator types
|
||||
#define ZLIST_FORWARD true
|
||||
#define ZLIST_REVERSE false
|
||||
|
||||
template <typename T>
|
||||
class ZListIterator : public ZListIteratorImpl<T, ZLIST_FORWARD> {
|
||||
public:
|
||||
ZListIterator(const ZList<T>* list);
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
class ZListReverseIterator : public ZListIteratorImpl<T, ZLIST_REVERSE> {
|
||||
public:
|
||||
ZListReverseIterator(const ZList<T>* list);
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
class ZListRemoveIterator : public ZListRemoveIteratorImpl<T, ZLIST_FORWARD> {
|
||||
public:
|
||||
ZListRemoveIterator(ZList<T>* list);
|
||||
};
|
||||
template <typename T> using ZListIterator = ZListIteratorImpl<T, true /* Forward */>;
|
||||
template <typename T> using ZListReverseIterator = ZListIteratorImpl<T, false /* Forward */>;
|
||||
template <typename T> using ZListRemoveIterator = ZListRemoveIteratorImpl<T, true /* Forward */>;
|
||||
|
||||
#endif // SHARE_GC_Z_ZLIST_HPP
|
||||
|
||||
@ -232,16 +232,4 @@ inline bool ZListRemoveIteratorImpl<T, Forward>::next(T** elem) {
|
||||
return *elem != NULL;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline ZListIterator<T>::ZListIterator(const ZList<T>* list) :
|
||||
ZListIteratorImpl<T, ZLIST_FORWARD>(list) {}
|
||||
|
||||
template <typename T>
|
||||
inline ZListReverseIterator<T>::ZListReverseIterator(const ZList<T>* list) :
|
||||
ZListIteratorImpl<T, ZLIST_REVERSE>(list) {}
|
||||
|
||||
template <typename T>
|
||||
inline ZListRemoveIterator<T>::ZListRemoveIterator(ZList<T>* list) :
|
||||
ZListRemoveIteratorImpl<T, ZLIST_FORWARD>(list) {}
|
||||
|
||||
#endif // SHARE_GC_Z_ZLIST_INLINE_HPP
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user