I like the shorter form, but keep in mind that when the return type
needs to be specified,
[] ->foo { // lambda content }
is not possible, and following is needed:
[]() -> foo { // lambda content }
Philippe
On Wed, 9 Jan 2019 19:08:46 +0100
"André Hartmann" <[email protected]> wrote:
> Hi all,
>
> I recently found an inconsistency regarding empty lambda parameter lists
> between [1] and [2]. While the first states, that parentheses have to be
> written always, the latter is missing this section.
>
> My request to syncronize both [3] lead to the conclusion, to change the rule,
> so that empty parameter lists should be written as
>
> [] { // lambda content }
>
> instead
>
> []() { // lambda content }
>
> If anyone has objections against this change, please vote at [3].
> I'll keep this commit open a while and adopt the Wiki [1] once the change
> is approved without objections.
>
> Thanks and regards,
> André
>
> [1] https://wiki.qt.io/Coding_Conventions#Lambdas
> [2] https://code.woboq.org/qt5/qt-creator/doc/api/coding-style.qdoc.html#772
> [3] https://codereview.qt-project.org/249192
> _______________________________________________
> Development mailing list
> [email protected]
> https://lists.qt-project.org/listinfo/development
_______________________________________________
Development mailing list
[email protected]
https://lists.qt-project.org/listinfo/development