aboutsummaryrefslogtreecommitdiff
path: root/gdbsupport/next-iterator.h
diff options
context:
space:
mode:
Diffstat (limited to 'gdbsupport/next-iterator.h')
-rw-r--r--gdbsupport/next-iterator.h18
1 files changed, 4 insertions, 14 deletions
diff --git a/gdbsupport/next-iterator.h b/gdbsupport/next-iterator.h
index d4d98a0..d630f3c 100644
--- a/gdbsupport/next-iterator.h
+++ b/gdbsupport/next-iterator.h
@@ -35,21 +35,12 @@ struct next_iterator
typedef std::forward_iterator_tag iterator_category;
typedef int difference_type;
- explicit next_iterator (T *item)
- : m_item (item)
- {
- }
+ explicit next_iterator (T *item) : m_item (item) {}
/* Create a one-past-the-end iterator. */
- next_iterator ()
- : m_item (nullptr)
- {
- }
+ next_iterator () : m_item (nullptr) {}
- value_type operator* () const
- {
- return m_item;
- }
+ value_type operator* () const { return m_item; }
bool operator== (const self_type &other) const
{
@@ -68,13 +59,12 @@ struct next_iterator
}
private:
-
T *m_item;
};
/* A convenience wrapper to make a range type around a next_iterator. */
-template <typename T>
+template<typename T>
using next_range = iterator_range<next_iterator<T>>;
#endif /* COMMON_NEXT_ITERATOR_H */