![]() |
|
|
|
#1
|
|||
|
|||
|
For the first question for some more interesting detail (its very compiler specific of course), taken from StackOverflow
Quote:
Quote:
A pointer to a function pointer is data again too and so the function pointer is much more specific. 3) as far as I know its the captures that are on the temporary object, and the actual function arguments are passed per __thiscall logic. I did not give any interviews with these questions but it would be interesting to see what creative answers people would come up with. Obviously these are a bit to technical and advanced to do more than probe and analyze people's knowledge a bit. Would be interesting to see them used for a "Senior Reverse Engineer" job or the like .
|
| The Following User Says Thank You to chants For This Useful Post: | ||
zeffy (09-05-2019) | ||
|
#2
|
|||
|
|||
|
Quote:
Here's an example of how MSVC seems to implement lambdas: Code:
bool normal_function()
{
int a, b, c;
int d = 0;
int e = 0;
int f = 0;
return [a, b, c](int, int, int) -> bool {
return true;
}(d, e, f);
}
Code:
bool normal_function()
{
class lambda_class
{
int *a_;
int *b_;
int *c_;
public:
lambda_class(int *a, int *b, int *c)
: a_(a), b_(c), c_(c)
{
}
bool operator()(int d, int e, int f)
{
return true;
}
};
int a, b, c;
int d = 0;
int e = 0;
int f = 0;
return lambda_class(&a, &b, &c)(d, e, f);
}
|
| The Following User Says Thank You to zeffy For This Useful Post: | ||
chants (09-05-2019) | ||
![]() |
| Thread Tools | |
| Display Modes | |
|
|