Re: [PATCH] tree: introduce range adaptor for TREE_VEC

2022-05-11 Thread Jason Merrill via Gcc-patches
On 5/11/22 15:20, Patrick Palka wrote: This patch implements a simple tree wrapper, named tree_vec_range, which lets us idiomatically iterate over all the elements of a TREE_VEC using a C++11 range-based for loop: // v is a TREE_VEC for (tree e : tree_vec_range (v)) ... This is simil

[PATCH] tree: introduce range adaptor for TREE_VEC

2022-05-11 Thread Patrick Palka via Gcc-patches
This patch implements a simple tree wrapper, named tree_vec_range, which lets us idiomatically iterate over all the elements of a TREE_VEC using a C++11 range-based for loop: // v is a TREE_VEC for (tree e : tree_vec_range (v)) ... This is similar to the existing tree-based range adaptors