【发布时间】:2016-05-03 09:53:25
【问题描述】:
以下代码的行为是否定义良好? f() 调用的行为如何?
#include <functional>
#include <iostream>
struct A
{
void shout()
{
std::cout <<"shout";
}
};
int main()
{
std::function<void()> f;
{
A a;
f = std::bind(&A::shout, &a);
}
f(); // what happens here?
}
【问题讨论】:
标签: c++ language-lawyer stdbind