lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] Not urgent: a plausible micro-optimization


From: Vadim Zeitlin
Subject: Re: [lmi] Not urgent: a plausible micro-optimization
Date: Thu, 22 Feb 2018 14:31:00 +0100

On Thu, 22 Feb 2018 01:40:25 +0000 Greg Chicares <address@hidden> wrote:

GC> On 2018-02-17 16:56, Vadim Zeitlin wrote:
GC> [...]
GC> >   https://github.com/vadz/lmi/pull/68
GC> 
GC> Applied in spirit. C++ lambdas are far better than std::unary_function<T,T>,
GC> but I don't think I'll ever find them as easy to read as flat procedural 
code:
GC> the weird syntax keeps them from being altogether transparent.

 As with everything else, you get used to it and while it's indeed
objectively weird, it's not that bad. Also, the lambdas are certainly
not necessary here, but they're all but required in many other situations,
so I'm afraid you don't really have any choice except to get used to them...

 Anyhow, once again, I don't mind at all not using lambdas here, but the
assignment of wxFrame::GetChildren() to std::list<> does bother me because
this only compiles in STL build of wxWidgets and I'd like to be able to
build lmi with the default build not using STL. I see 2 possibilities to do
it:

1. Keep the same logic as in my original PR, but use a separate (member)
   function instead of lambda. I think this would be preferable, but I
   suspect you disagree because otherwise you'd probably have done it
   yourself.

2. Replace the existing assignment with a copy. This is what I did in a
   new https://github.com/vadz/lmi/pull/69

 I can keep this PR only in my local fork, of course, but I think it
doesn't really cost much to apply it and it's not less clear than the
existing code (in fact, I find the existing comment about legacy container
rather confusing as it's not the assignment itself that ensures anything,
but rather the fact that the assignment compiles...).

 Thanks in advance,
VZ


reply via email to

[Prev in Thread] Current Thread [Next in Thread]