[binutils-gdb] [gdbsupport] Use using instead of typedef in next_iterator

Tom de Vries via Gdb-cvs <[email protected]> Tue, 9 Jun 2026 12:37:26 +0000 (GMT)
Newsgroups gmane.comp.gdb.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1eed06ae51d73a195b78ce0903ada9c9c2c14cfb

commit 1eed06ae51d73a195b78ce0903ada9c9c2c14cfb
Author: Tom de Vries <[email protected]>
Date:   Tue Jun 9 14:37:16 2026 +0200

    [gdbsupport] Use using instead of typedef in next_iterator
    
    Use using instead of typedef in next_iterator.  While we're at it, do the same
    in basic_safe_iterator.
    
    Suggested-By: Simon Marchi <[email protected]>
    Co-Authored-By: Simon Marchi <[email protected]>

Diff:
---
 gdbsupport/next-iterator.h | 12 ++++++------
 gdbsupport/safe-iterator.h | 12 ++++++------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/gdbsupport/next-iterator.h b/gdbsupport/next-iterator.h
index 0c90428d349..9f0aba7f8c4 100644
--- a/gdbsupport/next-iterator.h
+++ b/gdbsupport/next-iterator.h
@@ -28,12 +28,12 @@
 template<typename T>
 struct next_iterator
 {
-  typedef next_iterator self_type;
-  typedef T *value_type;
-  typedef T *&reference;
-  typedef T **pointer;
-  typedef std::forward_iterator_tag iterator_category;
-  typedef int difference_type;
+  using self_type = next_iterator;
+  using value_type = T *;
+  using reference = T *&;
+  using pointer = T **;
+  using iterator_category = std::forward_iterator_tag;
+  using difference_type = int;
 
   explicit next_iterator (T *item)
     : m_item (item)
diff --git a/gdbsupport/safe-iterator.h b/gdbsupport/safe-iterator.h
index 3e5d1140179..6c5a2901c7e 100644
--- a/gdbsupport/safe-iterator.h
+++ b/gdbsupport/safe-iterator.h
@@ -43,12 +43,12 @@ template<typename Iterator>
 class basic_safe_iterator
 {
 public:
-  typedef basic_safe_iterator self_type;
-  typedef typename Iterator::value_type value_type;
-  typedef typename Iterator::reference reference;
-  typedef typename Iterator::pointer pointer;
-  typedef typename Iterator::iterator_category iterator_category;
-  typedef typename Iterator::difference_type difference_type;
+  using self_type = basic_safe_iterator;
+  using value_type = typename Iterator::value_type;
+  using reference = typename Iterator::reference;
+  using pointer = typename Iterator::pointer;
+  using iterator_category = typename Iterator::iterator_category;
+  using difference_type = typename Iterator::difference_type;
 
   /* Construct the iterator using the underlying iterator BEGIN; the end
      iterator is default constructed.  */