[05/10,gdbsupport] Use using instead of typedef in next_iterator

Message ID 20260501124504.2233495-6-tdevries@suse.de
State New
Headers
Series Add superblocks range loops |

Commit Message

Tom de Vries May 1, 2026, 12:44 p.m. UTC
  Use using instead of typedef in next_iterator.  While we're at it, do the same
in basic_safe_iterator.

Suggested-By: Simon Marchi <simon.marchi@polymtl.ca>
Co-Authored-By: Simon Marchi <simon.marchi@polymtl.ca>
---
 gdbsupport/next-iterator.h | 12 ++++++------
 gdbsupport/safe-iterator.h | 12 ++++++------
 2 files changed, 12 insertions(+), 12 deletions(-)
  

Patch

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.  */