Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [PATCH 05/10] [gdbsupport] Use using instead of typedef in next_iterator
Date: Fri,  1 May 2026 14:44:59 +0200	[thread overview]
Message-ID: <20260501124504.2233495-6-tdevries@suse.de> (raw)
In-Reply-To: <20260501124504.2233495-1-tdevries@suse.de>

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(-)

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


  parent reply	other threads:[~2026-05-01 12:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-01 12:44 [PATCH 00/10] [gdb] Add superblocks range loops Tom de Vries
2026-05-01 12:44 ` [PATCH 01/10] [gdb] Use block::containing_function Tom de Vries
2026-05-01 12:44 ` [PATCH 02/10] [gdb] Factor out block::containing_function_block Tom de Vries
2026-05-01 12:44 ` [PATCH 03/10] [gdb] Use block::containing_function_block Tom de Vries
2026-05-01 12:44 ` [PATCH 04/10] [gdb] Add unit test for next_iterator Tom de Vries
2026-05-01 12:44 ` Tom de Vries [this message]
2026-05-01 12:45 ` [PATCH 06/10] [gdbsupport] Factor out base_next_iterator Tom de Vries
2026-05-08 19:17   ` Tom Tromey
2026-05-01 12:45 ` [PATCH 07/10] [gdb] Add block::block_and_superblocks Tom de Vries
2026-05-01 12:45 ` [PATCH 08/10] [gdb] Use block::block_and_superblocks Tom de Vries
2026-05-08 19:41   ` Tom Tromey
2026-05-01 12:45 ` [PATCH 09/10] [gdb] Add block::block_and_superblocks_in_fn Tom de Vries
2026-05-01 12:45 ` [PATCH 10/10] [gdb] Use block::block_and_superblocks_in_fn Tom de Vries
2026-06-09 12:40 ` [PATCH 00/10] [gdb] Add superblocks range loops Tom de Vries

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260501124504.2233495-6-tdevries@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox