This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/54557] [c++ lambda] error in assigning lambda expr though "operator?:" while capturing
- From: "vincenzo.innocente at cern dot ch" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 13 Sep 2012 06:37:02 +0000
- Subject: [Bug c++/54557] [c++ lambda] error in assigning lambda expr though "operator?:" while capturing
- Auto-submitted: auto-generated
- References: <bug-54557-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54557
vincenzo Innocente <vincenzo.innocente at cern dot ch> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
Summary|[c++ lambda] error in |[c++ lambda] error in
|assigning lambda expr |assigning lambda expr
|though "operator?:" while |though "operator?:" while
|catching |capturing
--- Comment #2 from vincenzo Innocente <vincenzo.innocente at cern dot ch> 2012-09-13 06:37:02 UTC ---
Understood.
Thanks for the detailed answer: I will read the standard more in detail.
Syntactic-wise It seems that I can implement it as
bool A::foo4(int i, int j) const {
auto f1 = sel ? [](int a, int b,int) { return a<b;} :
[](int a, int b, int k) { return a<b+k;};
auto f = [this,f1](int a, int b) { return f1(a,b,q);};
return f(i,j);
}
As optimization is what I'm looking for
I will look to the generated assembler and then decide the specific
implementation.