Re: [PATCH RFA] vec: Simplify use with C++11 range-based 'for'.

2020-12-04 Thread Jason Merrill via Gcc-patches
On 12/4/20 3:39 AM, Richard Biener wrote: On Thu, Dec 3, 2020 at 10:46 PM Jeff Law via Gcc-patches wrote: On 12/3/20 10:53 AM, Jason Merrill via Gcc-patches wrote: It looks cleaner if we can use a vec* directly as a range for the C++11 range-based 'for' loop, without needing to indirect fro

Re: [PATCH RFA] vec: Simplify use with C++11 range-based 'for'.

2020-12-04 Thread Richard Biener via Gcc-patches
On Thu, Dec 3, 2020 at 10:46 PM Jeff Law via Gcc-patches wrote: > > > > On 12/3/20 10:53 AM, Jason Merrill via Gcc-patches wrote: > > It looks cleaner if we can use a vec* directly as a range for the C++11 > > range-based 'for' loop, without needing to indirect from it, and also works > > with nul

Re: [PATCH RFA] vec: Simplify use with C++11 range-based 'for'.

2020-12-03 Thread Jeff Law via Gcc-patches
On 12/3/20 10:53 AM, Jason Merrill via Gcc-patches wrote: > It looks cleaner if we can use a vec* directly as a range for the C++11 > range-based 'for' loop, without needing to indirect from it, and also works > with null pointers. > > The change in cp_parser_late_parsing_default_args is an exam

Re: [PATCH RFA] vec: Simplify use with C++11 range-based 'for'.

2020-12-03 Thread Marek Polacek via Gcc-patches
On Thu, Dec 03, 2020 at 12:53:22PM -0500, Jason Merrill via Gcc-patches wrote: > It looks cleaner if we can use a vec* directly as a range for the C++11 > range-based 'for' loop, without needing to indirect from it, and also works > with null pointers. Nice. > The change in cp_parser_late_parsing

[PATCH RFA] vec: Simplify use with C++11 range-based 'for'.

2020-12-03 Thread Jason Merrill via Gcc-patches
It looks cleaner if we can use a vec* directly as a range for the C++11 range-based 'for' loop, without needing to indirect from it, and also works with null pointers. The change in cp_parser_late_parsing_default_args is an example of how this can be used to simplify many loops over vec*. I delib