看下面的片段:
struct Event
{
void event1( time_t t );
void event2( int, int );
}
Event* f = ...;
time_t t; int i1, int i2;
// 1st
std::thread t{ std::bind( &Event::event1, f, std::placeholders::_1 ), t };
std::thread t{ std::bind( &Event::event2, f, std::placeholders::_1, std::placeholders::_2 ), i1, i2 };
// 2nd method
std::thread t{ &Event::event1, f, t };
std::thread t{ &Event::event2, f, i1, i2 };
这是第一种方法和第二种方法之间的区别。哪种方法更好?