[webkit-dev] [Styling] Space between [] and () in C++ lambdas
Yusuke Suzuki
ysuzuki at apple.com
Fri Nov 1 13:49:11 PDT 2019
> On Nov 1, 2019, at 11:53, Michael Catanzaro <mcatanzaro at gnome.org> wrote:
>
> On Fri, Nov 1, 2019 at 11:19 am, Ryosuke Niwa <rniwa at webkit.org> wrote:
>> Namely, some people write a lambda as:
>> auto x = [] () { }
>> with a space between [] and () while others would write it as:
>> auto x = []() { }
>
> : I omit the () when there are no parameters, as in these examples.
>
> No preference on spacing.
I like having a space here, because this rule is simpler to me.
If we always have a space between them, this is clear that the above case is written in `[] { }` instead of `[]{ }`.
-Yusuke
>
>
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> https://lists.webkit.org/mailman/listinfo/webkit-dev
More information about the webkit-dev
mailing list