aboutsummaryrefslogtreecommitdiff
path: root/gdbsupport/iterator-range.h
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2023-02-08 15:36:23 -0500
committerSimon Marchi <simon.marchi@polymtl.ca>2023-02-08 15:46:02 -0500
commitc583a2520616c2736cffc389c89a48b159366e6c (patch)
treeb4925f26506fcee96c16119431c01760f05db95d /gdbsupport/iterator-range.h
parentca7f92c2f15b86b09c4a8ad14806bef666308d31 (diff)
downloadgdb-users/simark/clang-format.zip
gdb-users/simark/clang-format.tar.gz
gdb-users/simark/clang-format.tar.bz2
Run clang-format.shusers/simark/clang-format
Change-Id: Ia948cc26d534b0dd02702244d52434b1a2093968
Diffstat (limited to 'gdbsupport/iterator-range.h')
-rw-r--r--gdbsupport/iterator-range.h27
1 files changed, 13 insertions, 14 deletions
diff --git a/gdbsupport/iterator-range.h b/gdbsupport/iterator-range.h
index e934f5e..4335510 100644
--- a/gdbsupport/iterator-range.h
+++ b/gdbsupport/iterator-range.h
@@ -22,7 +22,7 @@
/* A wrapper that allows using ranged for-loops on a range described by two
iterators. */
-template <typename IteratorType>
+template<typename IteratorType>
struct iterator_range
{
using iterator = IteratorType;
@@ -30,16 +30,18 @@ struct iterator_range
/* Create an iterator_range using BEGIN as the begin iterator.
Assume that the end iterator can be default-constructed. */
- template <typename... Args>
- iterator_range (Args &&...args)
- : m_begin (std::forward<Args> (args)...)
- {}
+ template<typename... Args>
+ iterator_range (Args &&...args) : m_begin (std::forward<Args> (args)...)
+ {
+ }
/* Create an iterator range using explicit BEGIN and END iterators. */
- template <typename... Args>
+ template<typename... Args>
iterator_range (IteratorType begin, IteratorType end)
- : m_begin (std::move (begin)), m_end (std::move (end))
- {}
+ : m_begin (std::move (begin)),
+ m_end (std::move (end))
+ {
+ }
/* Need these as the variadic constructor would be a better match
otherwise. */
@@ -47,15 +49,12 @@ struct iterator_range
iterator_range (const iterator_range &) = default;
iterator_range (iterator_range &&) = default;
- IteratorType begin () const
- { return m_begin; }
+ IteratorType begin () const { return m_begin; }
- IteratorType end () const
- { return m_end; }
+ IteratorType end () const { return m_end; }
/* The number of items in this iterator_range. */
- std::size_t size () const
- { return std::distance (m_begin, m_end); }
+ std::size_t size () const { return std::distance (m_begin, m_end); }
private:
IteratorType m_begin, m_end;