public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-6214] c++: add begin/end to releasing_vec
@ 2022-01-04 17:58 Jason Merrill
  0 siblings, 0 replies; only message in thread
From: Jason Merrill @ 2022-01-04 17:58 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:dd8020032401f6dcd76c41017fcf75816490836d

commit r12-6214-gdd8020032401f6dcd76c41017fcf75816490836d
Author: Jason Merrill <jason@redhat.com>
Date:   Thu Dec 30 09:13:44 2021 -0500

    c++: add begin/end to releasing_vec
    
    So C++11 range-for will work.
    
    gcc/cp/ChangeLog:
    
            * cp-tree.h (class releasing_vec): Add begin/end fns.

Diff:
---
 gcc/cp/cp-tree.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 824fe98a2e8..10ca8098a85 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -1008,6 +1008,9 @@ public:
      (bootstrap/91828).  */
   tree& operator[] (ptrdiff_t i) const { return (*v)[i]; }
 
+  tree *begin() { return ::begin (v); }
+  tree *end() { return ::end (v); }
+
   void release () { release_tree_vector (v); v = NULL; }
 
   ~releasing_vec () { release_tree_vector (v); }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-04 17:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-04 17:58 [gcc r12-6214] c++: add begin/end to releasing_vec Jason Merrill

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).