模板,让我欢喜让我忧
//谁能告诉我
//这是为什么
#include <boost/thread/thread.hpp>
#include <iostream>
struct module{
void run();
};
struct module_entry{
module_entry(module&){};
void operator() (){};
};
int main()
{
module m;
boost::thread t2(module_entry(m));
module_entry e(m);
boost::thread t1(e);
std::cout << typeid(t1).name() << std::endl;
std::cout << typeid(t2).name() << std::endl;
}
//output:
//class boost::thread
//class boost::thread (__cdecl*)(struct module_entry)