About your first question: what does ...lambda... mean
: Yes, obviously, it refers to a lambda function.
The second part of your first question: What is #2
: Some experimentation with lambda's shows that this is like a sequence number of lambda's within a function.
Note that gcc and clang have different ways of encoding this.
gcc
uses the lambda()#2
notation, while clang
uses something like $_1
.
Your second question: what is other_name
: I think that would be the function where the lambda is defined.
And some_name
being the function which is passed the lambda as a template parameter.
The lambda's themselves are passed as a struct containing either copies of values or pointers, or from a c++ point of view: references, to the closure defined by the lambda.
Experimenting with how your compiler treats lambda's is quite easy.
Write some test code:
#include <stdio.h>
template<typename FN>
int test(FN f)
{
return f();
}
int main(int, char**)
{
int a, b;
auto f1 = [](int a, int b) { return a+b; };
int c = test([&a, b, &f1]() { return f1(a,b); });
auto f2 = [](int a, int b) { return a-b; };
int d = test([&a, b, &f2]() { return f2(a,b); });
printf("c=%d, d=%d\n", c, d);
return 0;
}
Then compile with least optimization, and debug symbols:
g++ -O0 -g yourfile.cpp
And view the resulting binary in ida
.