[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Issue XXXX: Dot_configuration maintenance (issue 577380046 by addres
From: |
Han-Wen Nienhuys |
Subject: |
Re: Issue XXXX: Dot_configuration maintenance (issue 577380046 by address@hidden) |
Date: |
Sat, 25 Jan 2020 19:45:17 +0100 |
On Sat, Jan 25, 2020 at 7:37 PM <address@hidden> wrote:
>
> On 2020/01/25 18:24:32, hanwenn wrote:
> >
> https://codereview.appspot.com/577380046/diff/553430046/lily/dot-configuration.cc
> > File lily/dot-configuration.cc (right):
> >
> >
> https://codereview.appspot.com/577380046/diff/553430046/lily/dot-configuration.cc#newcode69
> > lily/dot-configuration.cc:69: auto process_entry = [d, k, &new_cfg,
> > &offset](const value_type &ent)
> > what does this syntax do?
>
> https://en.cppreference.com/w/cpp/language/lambda
>
> It defines a function named "process_entry" taking one argument (const
> value_type &). The body of the function can access variables d and k by
> value, and variables new_cfg and offset by reference. I think "this"
> might also be captured implicitly in this context, but I'd have to go to
> the documentation to refresh my memory.
>
> An alternative to using a lambda would be to move this stuff to a
> private member function, or maybe a static function in this file.
Thanks for the explanation!
--
Han-Wen Nienhuys - address@hidden - http://www.xs4all.nl/~hanwen