With C++ lambdas, what happens when you capture a reference by reference? Are you capturing a reference to a local object on the stack (the reference itself), or a reference to the object being referred to? Eg in the following code:
int& TestClass::returnReference()
{
static int i=0;
return i;
}
std::function<void ()> TestClass::testFunction()
{
int& memberRef = this->someIntMember;
int& intRef = returnReference();
auto lambda =
[&]
{
// What happens when you capture a reference by reference
// like memberRef or intRef?
};
return lambda;
}