+1 for []()

Regards,
Konstantin


чт, 10 янв. 2019 г. в 15:51, Vitaly Fanaskov <vitaly.fanas...@qt.io>:

> I vote for shorter form as well.
>
> But the documentation should be extended with the Philippe's second
> example. Trailing return type is rarely required, but we cannot omit
> parameters list in this case, because it leads to compilation error.
>
> On 1/9/19 8:31 PM, Philippe wrote:
> > 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" <aha_1...@gmx.de> 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
> >> Development@qt-project.org
> >> https://lists.qt-project.org/listinfo/development
> >
> > _______________________________________________
> > Development mailing list
> > Development@qt-project.org
> > https://lists.qt-project.org/listinfo/development
>
> --
> Best Regards,
>
> Fanaskov Vitaly
> Senior Software Engineer
>
> The Qt Company / Qt Quick and Widgets Team
>
> _______________________________________________
> Development mailing list
> Development@qt-project.org
> https://lists.qt-project.org/listinfo/development
>
_______________________________________________
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development

Reply via email to