From: Tom de Vries Date: Tue, 9 Jun 2026 12:37:16 +0000 (+0200) Subject: [gdbsupport] Use using instead of typedef in next_iterator X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1eed06ae51d;p=thirdparty%2Fbinutils-gdb.git [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 Co-Authored-By: Simon Marchi --- 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 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 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. */