In C++0x, we use use std::function
like the following:
int normal_function() {
return 42;
}
std::function<int()> f = normal_function;
So to get an std::function
instance, we have to define its type firstly. But it's boring and sometimes hard.
So, can we just use make to get a std::function
instance just like std::tuple
?
In fact, I just googled, C++0x doesn't provide such make facility.
Why C++0x no provide make facility?
Can we implement it?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…