Re: lambda coding style

2024-01-19 Thread Hans-Peter Nilsson
On Wed, 10 Jan 2024, Jason Merrill via Gcc wrote: > On 1/10/24 15:59, Marek Polacek wrote: > > On Wed, Jan 10, 2024 at 02:58:03PM -0500, Jason Merrill via Gcc wrote: > > > What formatting style do we want for non-trivial lambdas in GCC sources? > > > I'm thinking the most consistent choice would

Re: lambda coding style

2024-01-12 Thread Martin Jambor
Hi, On Thu, Jan 11 2024, Jason Merrill wrote: > On 1/11/24 12:48, Martin Jambor wrote: >> On Wed, Jan 10 2024, Jason Merrill via Gcc wrote: >>> What formatting style do we want for non-trivial lambdas in GCC sources? >>>I'm thinking the most consistent choice would be >>> >>> auto l = [&]

Re: lambda coding style

2024-01-11 Thread Jason Merrill via Gcc
On 1/11/24 12:48, Martin Jambor wrote: On Wed, Jan 10 2024, Jason Merrill via Gcc wrote: What formatting style do we want for non-trivial lambdas in GCC sources? I'm thinking the most consistent choice would be auto l = [&] (parms) // space between ] ( { // brace on new

Re: lambda coding style

2024-01-11 Thread Martin Jambor
Hi, On Wed, Jan 10 2024, Jason Merrill via Gcc wrote: > What formatting style do we want for non-trivial lambdas in GCC sources? > I'm thinking the most consistent choice would be > > auto l = [&] (parms) // space between ] ( >{ // brace on new line, indented two spaces >

Re: lambda coding style

2024-01-11 Thread Tom Tromey
> "Jason" == Jason Merrill via Gcc writes: Jason> I think we probably want the same formatting for lambdas in function Jason> argument lists, e.g. Jason> algorithm ([] (parms) Jason> { Jason> return foo; Jason> }); Jason> Any other opinions? FWIW gdb did pretty much this same

Re: lambda coding style

2024-01-10 Thread waffl3x via Gcc
On Wednesday, January 10th, 2024 at 7:34 PM, Jason Merrill via Gcc wrote: > > > On 1/10/24 16:41, Marek Polacek wrote: > > > On Wed, Jan 10, 2024 at 04:24:42PM -0500, Jason Merrill wrote: > > > > > On 1/10/24 15:59, Marek Polacek wrote: > > > > > > > On Wed, Jan 10, 2024 at

Re: lambda coding style

2024-01-10 Thread Jason Merrill via Gcc
On 1/10/24 16:41, Marek Polacek wrote: On Wed, Jan 10, 2024 at 04:24:42PM -0500, Jason Merrill wrote: On 1/10/24 15:59, Marek Polacek wrote: On Wed, Jan 10, 2024 at 02:58:03PM -0500, Jason Merrill via Gcc wrote: What formatting style do we want for non-trivial lambdas in GCC sources? I'm

Re: lambda coding style

2024-01-10 Thread Marek Polacek via Gcc
On Wed, Jan 10, 2024 at 04:24:42PM -0500, Jason Merrill wrote: > On 1/10/24 15:59, Marek Polacek wrote: > > On Wed, Jan 10, 2024 at 02:58:03PM -0500, Jason Merrill via Gcc wrote: > > > What formatting style do we want for non-trivial lambdas in GCC sources? > > > I'm thinking the most consistent

Re: lambda coding style

2024-01-10 Thread Jason Merrill via Gcc
On 1/10/24 15:59, Marek Polacek wrote: On Wed, Jan 10, 2024 at 02:58:03PM -0500, Jason Merrill via Gcc wrote: What formatting style do we want for non-trivial lambdas in GCC sources? I'm thinking the most consistent choice would be auto l = [&] (parms) // space between ] ( {

Re: lambda coding style

2024-01-10 Thread Marek Polacek via Gcc
On Wed, Jan 10, 2024 at 02:58:03PM -0500, Jason Merrill via Gcc wrote: > What formatting style do we want for non-trivial lambdas in GCC sources? > I'm thinking the most consistent choice would be > > auto l = [&] (parms) // space between ] ( > { // brace on new line, indented

lambda coding style

2024-01-10 Thread Jason Merrill via Gcc
What formatting style do we want for non-trivial lambdas in GCC sources? I'm thinking the most consistent choice would be auto l = [&] (parms) // space between ] ( { // brace on new line, indented two spaces return stuff; }; By default, recent emacs lines up the {