On 11/19/20 2:03 PM, José Abílio Matos wrote:

On Thursday, November 19, 2020 2:23:14 PM WET Jean-Marc Lasgouttes wrote:

> I have to say that lambdas are not my cup of tea, but the original code

> is not great either.


With variable capture lambdas can sometimes be subtle, but in this case that is not an issue and the code is a lot more readable. :-)

I find it makes a big difference for me, in terms of readability, if the lambda is separated out. E.g. instead of:

@@ -86,7 +87,8 @@ GuiCommandBuffer::GuiCommandBuffer(GuiView * view)
     : view_(view)
 {
     transform(lyxaction.func_begin(), lyxaction.func_end(),
-        back_inserter(commands_), firster());
+              back_inserter(commands_),
+              [](auto const & p) { return p.first; });

something like:

    auto pfirst = [](auto const & p) { return p.first; };
    transform(back_inserter(commands_), p.first);

I.e., it's parsing all the parens that is hard.

Riki


-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to